This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable SSH | |
touch /tmp/1/ssh | |
# Configure WiFi | |
cat > /tmp/1/wpa_supplicant.conf <<EOF | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
country=<TWO_LETTER_ISO_COUNTRY_CODE> | |
network={ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OLDIFS=$IFS | |
IFS=$'\n' | |
prefix=".old.conv.$(date +%Y%m%d_%H%M%S)" | |
for file in $(find . -type f -name '*.php*') ; do | |
if file "$file" | grep "ISO-8859 text" 2>/dev/null; then | |
echo "convert;${file};$(file $file)" | |
dir=$(dirname "$file") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:post('<site_url>',{param1:'value1',param2:'value2'});function post(a,b){const c=(e,f)=>Object.assign(document.createElement(e),f),d=c('form',{action:a,method:'post',hidden:true});for(const[e,f]of Object.entries(b))d.appendChild(c('input',{name:e,value:f}));document.body.appendChild(d),d.submit()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SelectTracks:Mode="Set" Track="0" TrackCount="1" | |
SelTrackStartToEnd: | |
Duplicate: | |
SelectTracks:Mode="Set" Track="0" TrackCount="1" | |
SelTrackStartToEnd: | |
Duplicate: | |
SelectTracks:Mode="Set" Track="1" TrackCount="1" | |
SelTrackStartToEnd: | |
Duplicate: | |
SelectTracks:Mode="Set" Track="1" TrackCount="1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
from datetime import datetime, timedelta | |
import jwt | |
subprocess.call( | |
"openssl genrsa -out private.pem 1024".split(" "), stderr=subprocess.DEVNULL | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# run with: python3 get_mediawiki_journal_year.py | |
# or send to the clipboard using: python3 get_mediawiki_journal_year.py | xclip -selection clipboard | |
# source: https://gist.github.com/tcarreira/dc75ab8e560a1134fbdd1fd280405e78 | |
""" | |
This script prints a mediawiki style Journaling page. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DOCKER_COMPOSE_PATH="/data/docker" | |
SERVICE_NAME="my-docker-compose.service" | |
SCRIPT_NAME="$(realpath "$0")" | |
echo_service_content() { | |
cat >&1 <<EOF | |
[Unit] | |
Description=Docker Compose service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
GIT_USER="${GIT_USER:-My Name}" | |
GIT_EMAIL="${GIT_EMAIL:[email protected]}" | |
INFO=${INFO:-yes} | |
DIR="${1:-.}" | |
apply_git_config() { | |
target=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASE_DIR=$(dirname "$0") | |
_cleanup() { | |
find "${BASE_DIR}" -type f -name "*.tf" -exec sh -c 'sed -i "s@prevent_destroy = false #REPLACED@prevent_destroy = true@g" $1' shell {} \; | |
} | |
_replace_prevent_destroy() { | |
find "${BASE_DIR}" -type f -name "*.tf" -exec sh -c 'sed -i "s@prevent_destroy = true@prevent_destroy = false #REPLACED@g" $1' shell {} \; | |
} |
OlderNewer