This file contains hidden or 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
sudo shutdown -r 15 $(cat <<EOF; | |
2015-11-07T03:34:41Z app[postgres.0000]: [TAG] text-search query doesn't contain lexemes: "" | |
EOF) |
This file contains hidden or 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
timeout 300s bash -c "until ping -c10 hostother; do false; done" | |
#https://serverfault.com/a/510931 |
This file contains hidden or 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
def my_round(x, prec=2, base=0.05): return (base * (np.array(x) / base).round()).round(prec) |
This file contains hidden or 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
Make a POST Request (TLDR: Use -X POST argument) | |
Add POST Data to a Request (TLDR: Use -d var=val argument) | |
Construct a Query String (TLDR: Use -G argument) | |
Add HTTP Headers (TLDR: Use -H 'Header: Value' argument) | |
Change the User Agent (TLDR: Use -A 'User Agent' argument) | |
Set Cookies (TLDR: Use -b name=value argument) | |
Add a Referrer (TLDR: Use -e URL argument) | |
Follow a 3XX Redirect (TLDR: Use -L argument) | |
Use the Basic HTTP Authentication (TLDR: Use -u user:pass argument) | |
Print the Response Headers (TLDR: Use -i argument) |
This file contains hidden or 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 bash | |
#https://stackoverflow.com/a/30494746 | |
if [ "$#" -eq 2 ]; then | |
echo "$(echo "$(curl https://api.github.com/repos/$1/$2 2>/dev/null | grep size | tail -1 | tr -dc '[:digit:]')") KB" | |
elif [ "$#" -eq 1 ]; then | |
echo "$(echo "$(curl $1 2>/dev/null | grep size | tail -1 | tr -dc '[:digit:]')") KB" | |
#elif [ "$#" -eq 3 ] && [ "$1" == "-z" ]; then | |
# edit: Content-Length doesn't appear to show up anymore for a git repo. A 404 repo shows Content-Length of 15 but otherwise the | |
# field is non-existant |
This file contains hidden or 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
//https://www.jennyscrayoncollection.com/2018/10/complete-list-of-retired-crayola-crayon.html | |
[ | |
{ | |
"name": "Almond", | |
"value": "#EFDECD", | |
}, | |
{ | |
"name": "Antique Brass", | |
"value": "#CD9575", | |
}, |
This file contains hidden or 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
--[[ | |
#===================================================================================== | |
# arcolinux | |
# Date : package-date | |
# Author : Erik Dubois at http://www.erikdubois.be | |
# Version : package-version | |
# License : Distributed under the terms of GNU GPL version 2 or later | |
# Documentation : http://erikdubois.be/ | |
#====================================================================================== | |
# CONKY |
This file contains hidden or 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 bash | |
if ps aux | grep qemu | grep "guest="; then | |
mode='performance' | |
else | |
mode='powersave' | |
fi | |
cpus=$(grep -c processor /proc/cpuinfo 2>/dev/null) | |
date=$(date "+%d.%m.%Y %T") |
This file contains hidden or 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
# | |
# 4chan Webm Downloader | |
# Fetches all webms from a thread | |
# filters out all the .webm files | |
# and downloads to a custom path | |
# using wget | |
# | |
# Requires | |
# nokogiri: gem install nokogiri | |
# |
This file contains hidden or 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
function topcommands () { | |
#usage: topcommands [n] | |
# default is top 10 commands | |
if [ "$1" == "" ]; then | |
history | awk '{c[$2]++}END{for(i in c){print c[i] " " i}}' | sort -rn | head | |
else | |
history | awk '{c[$2]++}END{for(i in c){print c[i] " " i}}' | sort -rn | head -n "$1" | |
fi | |
} |