Skip to content

Instantly share code, notes, and snippets.

#cloud-config
packages:
- nginx
#jq is a command-line json processor https://stedolan.github.io/jq/
- jq
- unattended-upgrades
runcmd:
- export DOMAIN=your_domain_here.com
- export DO_API_TOKEN=PASTE_YOUR_DIGITALOCEAN_API_TOKEN_HERE
- export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)
@seajaysec
seajaysec / customqueries.json
Last active May 1, 2024 15:59
bloodhound custom queries
{
"queries": [{
"name": "List all owned users",
"queryList": [{
"final": true,
"query": "MATCH (m:User) WHERE m.owned=TRUE RETURN m"
}]
},
{
"name": "List all owned computers",
@Klerith
Klerith / parse-jwt.js
Created March 15, 2018 15:07
Parse - JWT - Obtener Payload y fecha de creación y expiración
function parseJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
};
@masklinn
masklinn / cheatsheet.md
Last active May 1, 2024 15:58
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@mayconbordin
mayconbordin / progress_bar.php
Created June 2, 2012 23:55
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}
#!/bin/sh
/Applications/Discord.app/Contents/MacOS/Discord --proxy-server=http://po.cc.ibaraki-ct.ac.jp:3128
@TheoKondak
TheoKondak / LG HUB - Copy Settings to Multiple Accounts.md
Last active May 1, 2024 15:56
How to migrate Logitech HUB Profile details to another Windows Account/Device

The Problem:

I want to use Logitech Hub profiles in multiple Windows accounts and multiple Windows Devices. Logitech Hub allows me to upload a profile linked to my account or public, when I download the profile on the second account/machine, the profile is being assigned to the default profile. I was not able to find a way to reassign macros etc to the actual Application profile.

The Solution:

The problem is that in each instance of Logitech Hub, each app has a unique ID, this ID is not transferable to another instance of the application. Even when I upload a profile to my online Logitech profile when I download it back to my device, it can't assign it to the correct ID, so it stays in the Default profile.

@jackrobertscott
jackrobertscott / MonacoEditorReactHooks.ts
Created November 18, 2019 12:28
Microsoft monaco editor made with react hooks.
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
import 'monaco-editor/esm/vs/language/css/monaco.contribution'
import 'monaco-editor/esm/vs/language/html/monaco.contribution'
import 'monaco-editor/esm/vs/language/json/monaco.contribution'
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution'
import 'monaco-editor/esm/vs/basic-languages/monaco.contribution'
import { createElement as create, FC, useRef, useEffect } from 'react'
import { css } from 'emotion'
import { useTheme } from '../hooks/useTheme'
@gbere
gbere / install_less_on_ubuntu
Created June 18, 2013 16:50
install less on ubuntu
cd ~
sudo apt-get update
sudo apt-get install git-core curl build-essential openssl libssl-dev
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
node -v
sudo ln -s $HOME/node/ /usr/local/lib/node
@hungneox
hungneox / WIN10.MD
Last active May 1, 2024 15:53
How Make a Windows 10 USB Using Your Mac - Build a Bootable ISO From Your Mac's Terminal

Most new PCs don't come with DVD drives anymore. So it can be a pain to install Windows on a new computer.

Luckily, Microsoft makes a tool that you can use to install Windows from a USB storage drive (or "thumbdrive" as they are often called).

But what if you don't have a second PC for setting up that USB storage drive in the first place?

In this tutorial we'll show you how you can set this up from a Mac.

Step 1: Download the Windows 10 ISO file

You can download the ISO file straight from Windows. That's right - everything we're going to do here is 100% legal and sanctioned by Microsoft.