Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / containerhelper
Created May 29, 2014 10:38
#!/bin/bash
#This is free and unencumbered software released into the public domain.
#Because this script needs root to do some things, excessive amounts of
#checking have been done to terminate the script if anything fails.
#Read all instructions very carefully. When it asks to type "yes", it must be
#all uppercase or it will fail.
@stlehmann
stlehmann / exec_script.py
Created May 6, 2014 15:21
Execute a Python script from Python console
#Python2
execfile("./filename")
#Python3
exec(open("./filename").read())
@vsoch
vsoch / index.php
Last active February 15, 2024 05:20
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";

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
@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 \
@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
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
@funkenstrahlen
funkenstrahlen / encode_to_mp4.sh
Last active August 29, 2015 13:56
A small script to convert all AVI files in a folder to mp4/h264
#!/bin/bash
#
# A small script to convert all AVI files in a folder to mp4 h264
# You can either use HandbrakeCLI or ffmpeg.
# ffmpeg requires to be compiled with libx264 which is not default in debian based distributions
#
# To use HandbrakeCLI do not forget to install the packages!
# For Linux Mint I had to do the following to get HandbrakeCLI running:
# sudo add-apt-repository ppa:stebbins/handbrake-snapshots
# sudo apt-get update
anonymous
anonymous / hooks.rb
Created February 25, 2014 22:42
require 'nokogiri'
module Try
def try(method, args = [])
if self.respond_to? method
self.send method, *args
end
end
end
@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