Skip to content

Instantly share code, notes, and snippets.

@J2R5M3
J2R5M3 / reddit.sh
Created June 27, 2012 22:32
Reddit bash script
#!bin/bash
function RedditDir {
if [ -d ~/reddit ]
then
cd ~/reddit
else
mkdir ~/reddit
cd ~/reddit
fi
@marlluslustosa
marlluslustosa / SSS reverse "caseiro" (aka serveo.net))
Last active May 5, 2018 16:07 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all.The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.
What
====
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).
Requirements
============
@monokrome
monokrome / commands
Last active December 17, 2018 22:33
Some of my weechat settings
/key bind meta-ctrl-I /go
/key unbind ctrl-W
/key bind ctrl-Wl /window right
/key bind ctrl-Wh /window left
/key bind ctrl-Wj /window down
/key bind ctrl-Wk /window up
/key bind ctrl-Wmeta2-C /window right
@codyeatworld
codyeatworld / ffmpeg.rb
Created September 27, 2012 14:09
Install FFMpeg, x264, fdk-aac, libvpx, qt-faststart.
# Notes:
# -----------------------------------------------------------------
# Ubuntu 12.04
# Sep 27, 2012
# -----------------------------------------------------------------
# I followed the instructions located on their website.
# https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
#
# I ran into the following errors.
# -----------------------------------------------------------------
@alganet
alganet / serve.sh
Last active July 17, 2020 05:42
Serve any folder as a web server with $ curl -L http://tinyurl.com/servesh1 | sh
#!/usr/bin/env sh
# serve.sh
# Modular version: https://gist.github.com/alganet/a22a1373dcee7c175d1e
# Expansion on zsh
command -v setopt 2>&1 >/dev/null && setopt SH_WORD_SPLIT
# POSIX on bash
export POSIXLY_CORRECT=1
# Lists files and folders as HTML
@ChickenProp
ChickenProp / gist:3037292
Created July 3, 2012 03:08
Connecting my Raspberry Pi to the internet via my laptop

After installing Arch on my Raspberry Pi, internet worked out of the box: I could plug it into the router, turn it on, ssh in and start downloading things. But the router is in my housemate's bedroom, which isn't ideal. If I want the Pi to be connected to the internet in my room, I need it to be connected to my laptop. (Another option would be a USB wifi dongle, of course.) This is how I did it. Much credit goes to the Ubuntu wiki's Connection sharing page.

I should disclaim that I don't fully understand networking stuff, and some of what I say might be wrong. I also didn't write this as I was going; so while I've consulted my browser and shell histories, it's possible I've forgotten some steps.

My laptop is running Gentoo, and this is where most of the work has to be done. It connects to the internet through wifi, on interface wlan0. The ethernet port is eth0, and eth0 is also the name of the ethernet port on the Pi.

Step zero: plug ev

@ruzickap
ruzickap / openwrt_vnstat.sh
Created April 7, 2014 08:01
OpenWrt vnStat configuration
opkg install luci-app-vnstat vnstati
mkdir /etc/vnstat /www3/myadmin/vnstat
sed -i 's@^\(DatabaseDir\).*@\1 "/etc/vnstat"@' /etc/vnstat.conf
vnstat -u -i eth2
vnstat -u -i wlan0
vnstat -u -i br-lan
echo "*/5 * * * * vnstat -u" >> /etc/crontabs/root
@hthighway
hthighway / plexdrive.service
Last active March 16, 2021 20:30
SYSTEMD files for plexdrive. Ceates a plexdrive mount and then a UnionFS of local and remote content (SEE updated version here: https://github.com/hthighway/scripts/tree/master/plexdrive )
[Unit]
Description=Plexdrive
AssertPathIsDirectory=/mnt/plexdrive
After=network-online.target
[Service]
Type=simple
#
# uid & gid values are for the user that you want to run plexdrive, $id will give you the values for the logged in user
#
@riceo
riceo / cloudflare_dynamic_dns.py
Created April 16, 2012 21:52
Dynamic DNS with Cloudflare - Python Script
#!/usr/bin/python
# Set up a new A record in Cloudflare, add the details of it along with your account details below
# Make sure this script runs on startup (or whenever you get a new IP...)
#
# @author Aaron Rice <aaron@duedil.com>
import urllib
import json
@0xAether
0xAether / 4chan.sh
Last active April 28, 2021 15:00
A bash function to download all the images in a 4chan thread
function 4chan() {
if [[ $# -ne 1 ]]
then
echo 'No URL specified! Give the URL to the thread as the ONLY argument'
return 1
fi
# This should look something like: g/thread/73097964
urlPrimative=$(grep -o '[0-9a-zA-Z]\{1,4\}/thread/[0-9]*' <<< $1)