Skip to content

Instantly share code, notes, and snippets.

@Skylark95
Skylark95 / ImgurAlbum.sh
Created July 10, 2013 22:52
Bash script to download images for an Imgur album
#!/bin/bash
#
# ImgurAlbum.sh
#
# Bash script to download images for an Imgur album
#
if [ -z "$1" ]; then
echo "ImgurAlbum: missing Album ID"
echo "Usage: ImgurAlbum [Album ID]"
exit
@cristianbica
cristianbica / install_ffmpeg.sh
Last active August 30, 2021 12:03
Install FFmpeg, x264, aac
#!/bin/bash
dpkg -l x264 fdk-aac libvpx libaacplus ffmpeg 2>/dev/null >/dev/null && echo "Packages are already installed" && exit
#cleanup
cd
sudo rm -rf fdk-aac-0.1.0* ffmpeg* libaacplus-2.0.2* libvpx* x264*
sudo apt-get -y remove ffmpeg fdk-aac libaacplus x264 libav-tools libvpx-dev libx264-dev libvpx
sudo apt-get update
sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \
@nonohry
nonohry / Link Download
Last active November 1, 2021 08:59
Link Download
# Ruby Thread Pool
# ================
# A thread pool is useful when you wish to do some work in a thread, but do
# not know how much work you will be doing in advance. Spawning one thread
# for each task is potentially expensive, as threads are not free.
#
# In this case, it might be more beneficial to start a predefined set of
# threads and then hand off work to them as it becomes available. This is
# the pure essence of what a thread pool is: an array of threads, all just
# waiting to do some work for you!
@rbrooks
rbrooks / shape_bandwidth.sh
Created May 17, 2012 16:03
Bandwidth Shape (Throttle) a Network Interface
#!/bin/bash
#
# tc uses the following units when passed as a parameter.
# kbps: Kilobytes per second
# mbps: Megabytes per second
# kbit: Kilobits per second
# mbit: Megabits per second
# bps: Bytes per second
# Amounts of data can be specified in:
# kb or k: Kilobytes
@chergaoui
chergaoui / Extract frame from video
Created February 19, 2014 16:38
Quick script I recently used to extract a frame from a .webm file. The frame is saved as a .png file.
#!/bin/bash
# NB: the script file must be in the same directory as media files
FILES=./*.webm
for f in $FILES
do
echo "Processing $f file..."
ffmpeg -i "$f" -ss 10 -vframes 1 "$f.png"
done
@moshest
moshest / p2p-list.md
Last active February 13, 2022 09:33
A collection of peer-to-peer decentralized projects.
@mopemope
mopemope / xvideos.py
Created October 4, 2011 15:01
xvideos downloader
import os
from os import path
from werkzeug import secure_filename
from tobikko.core import *
from tobikko.patch import *
patch_all()
import urllib2
from pyquery import PyQuery as pq
import urllib
from urlparse import urlparse
@GermainZ
GermainZ / clbin
Last active March 27, 2022 04:30
Upload text/images to clbin.com from the command line
#!/usr/bin/env bash
# Upload text/images to clbin.com from the command line
# License: ISC http://www.isc.org/downloads/software-support-policy/isc-license/
clip() {
if command -v xclip &> /dev/null; then
xclip -selection clip <<< "$@"
elif command -v xsel &> /dev/null; then
xsel -b -i <<< "$@"
fi

Install raspbian, set up your users however you would like, so long as you have sudo access on the user you are running this with. You probably want to resize the image so it fills the SD card as well.

  1. Copy this entire gist to your raspberry pi
  2. Do chmod +x step1.sh step2.sh iptables.sh in the gist folder (so that
  3. Run step1.sh a) This script does a few things - it first updates your raspberry pi, then it installs a few needed utilities, then it upgrades the firmware on your raspberry pi