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/bash | |
# Declare the variables needed | |
host= # @ or subdomain | |
domain= # TLD | |
ddns_password= # Password as found in advanced dns settings | |
# get the current ip address, try with another service if this one is down | |
array_of_ip_services=( "https://icanhazip.com" "http://ipinfo.io/ip" "http://ifconfig.me/ip" "http://ipecho.net/plain" "http://checkip.amazonaws.com" "http://myexternalip.com/raw" "http://ipecho.net/plain" ) |
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
# History search helper | |
# usage: his query1 query2 queryn... | |
# example: his ssh 192 (search all ssh commands done to ips inclusing 192) | |
# example: his sed jsx react (search all sed commands that include "jsx" and "react") | |
function his() { | |
# Store the full history in a variable | |
# Command order: history, remove line numbers, remove leading and trailing whitespace, sort, remove duplicates | |
# Note that we are using a naive way of removing the line numbers | |
commandlog=$(history | grep -oE "[a-zA-Z]{1}.*" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | sort | uniq) |
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
# CHANGE THESE | |
yourlicensekey=abc123 | |
[email protected]:/var/www/domainfolder | |
# Download sendy zip | |
curl --output sendy.zip https://sendy.co/download/?license=$yourlicensekey && \ | |
# Remove old sendy folder if it exists | |
rm -rf sendy && \ | |
# unzip update payload | |
unzip sendy.zip && \ |
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
## | |
# These commands can all be run as Tasker shell commands, or through adb | |
# NOTE ON ROOT: I noticed many commands work through the adb shell, but fail in tasker unless using ROOT. If you tasks fail, try enabling root for it | |
## | |
## SETTING THINGS | |
# Enable deep doze | |
dumpsys deviceidle force-idle |
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/zsh | |
RED="\033[0;31m" | |
GREEN="\033[0;32m" | |
YELLOW="\033[1;33m" | |
NC="\033[0m" # No Color | |
# Called as islive url title | |
function isLive() { | |
if curl -Is $1 2>&1 | grep -q 'HTTP.* 200'; then |
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
// This script is terribly inefficient, but on a decent computer it takes 1 second to complete anyway. I made it on an airplane while half asleep. | |
const target = 600000 // The target net worth | |
const roi = 4 // The assumed return on investment yearly | |
const term = 20 // Time until retirement | |
const start = 0 // Starting capital | |
const desire = 600000 // Desired capital | |
// Configuration | |
const verbose = false |
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
/* | |
NOTE: Made on Sept 20 2016, it might be that the site was edited since them | |
The below jQuery snippet will deselect any contacts you import from Linkedin | |
Usage: when prompted with the list of users to invite, run this in the console, it will deselect users not in Angellist | |
Much love from Amsterdam | |
@actuallymentor |
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
// Input it initial amount | |
// Interest as a number, e.g. 5% is 1.05 on a yearly basis | |
// Length as number of years | |
// Name of this calculation | |
// Addition determines whether the input variable is one time or a yearly contribution | |
function compound( input, interest, length, name, addition ) { | |
var accumulated = input | |
for ( i=0; i < length; i++ ) { | |
accumulated *= interest | |
if ( addition ){ |
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
#This function when added to ~/.bashrc_profile will allow you to use | |
#the command 'push "Commit message"' to lazily push your repo to your git server | |
push() { | |
#Add commit and push | |
git add * | |
git commit -a -m "$1" | |
git push | |
} |
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
# You need a recent version of jpegoptim and pngquant for this | |
yes | apt-get install jpegoptim | |
yes | apt-get install pngquant; | |
# Navigate to your wp-content/uploads | |
#optimize JPEG | |
optimizelossy() { jpegoptim -v *.jpg --max=80; for i in *; do if test -d $i; then cd $i; echo $i; optimizelossy; cd .. ; fi; done; echo; } | |
optimizelossy |