Skip to content

Instantly share code, notes, and snippets.

@dfletcher
dfletcher / tsws
Last active July 21, 2018 12:47
Totally simple web server using Bash and netcat (nc)
Moved to a proprer repositoy, TSWS is a real boy now!
https://github.com/dfletcher/tsws
PRs welcomed.
@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active November 21, 2023 19:48
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@coolaj86
coolaj86 / email to text.md
Last active March 28, 2022 21:22
List of free email to text services
@djmaze
djmaze / install-oath-hotp-on-yubikey.sh
Created December 13, 2013 21:35
Setting up the OATH HOTP applet on the Yubikey NEO with Arch Linux
# Install personalization tools
yaourt -S yubikey-personalization-gui-git
# Change the key's USB mode to 82
sudo ykpersonalize -m 82
# Install gpshell and cap file
yaourt -S ccid gpshell gppcscconnectionplugin
wget http://opensource.yubico.com/ykneo-oath/releases/ykneo-oath-0.2.1.cap
wget https://raw.github.com/Yubico/ykneo-oath/master/gpinstall.txt
@vbtechsupport
vbtechsupport / ghost1
Last active August 16, 2016 08:28
ghost.centminmod.com CentOS 6.4 init.d startup script configured for per Ghost install instance + clearing Nginx proxy_cache on restart. http://ghost.centminmod.com/ghost-blog-node-js-init-startup-script/
#!/bin/bash
###########################################
# chkconfig: 2345 98 02
#
# description: PM2 next gen process manager for Node.js
# processname: ghost1
#
### BEGIN INIT INFO
# Provides: ghost1
# Required-Start:
server {
listen 80;
server_name MY.WEBSITE.TLD;
root /Users/ME/Sites/FOLDER;
client_header_buffer_size 16k;
large_client_header_buffers 16 16k;
# qsa
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@cdown
cdown / gist:1163649
Last active April 9, 2024 01:10
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@bulljit
bulljit / transmissionUnRAR.sh
Created January 23, 2011 02:31
Transmission-Daemon Script: OnComplete unrar files and delete torrent
#!/bin/sh
DEST_DIR="/some/other/dir"
function linker() { # create simlink to downloaded files, rather than copy to final directory
if [ ! -d "$DEST_DIR/$1" ]; then mkdir "$DEST_DIR/$1"; fi
cd "$1"
for F in *; do
if [ -d "$F" ]; then linker "$1/$F"; fi
ln -s "$TR_TORRENT_DIR/$1/$F" "$DEST_DIR/$1"