Skip to content

Instantly share code, notes, and snippets.

@iDiogenes
iDiogenes / gist:3231039
Created August 1, 2012 21:49
RADIUS with MySQL Support
Ubuntu MySQL & RADIUS Howto:
Install MySQL
# apt-get install mysql-server mysql-client
Secure MySQL
Mysql_secure_installation
@philfreo
philfreo / bucket_policy.js
Created October 6, 2012 01:27
AWS S3 bucket policy to make all files public (+CORS)
{
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket_name_here/*"
@sytkov
sytkov / script.sh
Created November 3, 2012 16:26
oracle installation
iptables -I INPUT -p tcp --dport 1521 -j ACCEPT
iptables -I INPUT -p tcp --dport 1522 -j ACCEPT
@jcadam
jcadam / autostart.sh
Created November 11, 2012 14:46
My openbox autostart
# Run the system-wide support stuff
#. $GLOBALAUTOSTART
# Programs to launch at startup
# =============================
# Set-up keyboard maps and sytem tray switcher
# tip - quickly toggle between keyboard maps by holding both shift keys!
#setxkbmap -option grp:shifts_toggle,grp_led:scroll gb,us,de,fr &
setxkbmap -option grp:shifts_toggle,grp_led:scroll jp,us &
@jiceb
jiceb / gist:4109821
Created November 19, 2012 09:28
MySQL Dump All Databases and Create (or Recreate) them on Import
# export
mysqldump -u root -p --all-databases > all_dbs.sql
# import
mysql -u root -p < all_dbs.sql
@amontalenti
amontalenti / script-inject-http-proxy.js
Created November 21, 2012 17:16
script injecting proxy for Node.JS
var httpProxy = require('http-proxy');
var url = require('url');
httpProxy.createServer(function(req, res, proxy) {
var isHtml = false,
write = res.write,
writeHead = res.writeHead,
params = url.parse(req.url, true).query,
dest = params.dest || 'localhost',
@KartikTalwar
KartikTalwar / Documentation.md
Last active October 31, 2025 06:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@olivier-m
olivier-m / ssh-copy-id.sh
Last active February 22, 2022 16:01
ssh-copy-id for OSX - Copy this to a directory in your $PATH
#!/bin/sh
# Shell script to install your identity.pub on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
@marios-zindilis
marios-zindilis / VirtualHost for multiple WSGI applications
Last active September 9, 2018 10:24
VirtualHost definition (Apache2 on Ubuntu 12.04) for running multiple WSGI applications under the same domain. This was done for the purpose of running the example applications on http://webpy.org/src/ on a single test server. Some discussion for this at: https://groups.google.com/forum/#!topic/webpy/fB_DqRAg7ho
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName example.com
DocumentRoot /var/www/example.com
# Aliases (most deeply nested URL should come first):
Alias /test/web-py/blog /var/www/example.com/test/web-py/blog/index.py/
Alias /test/web-py/books /var/www/example.com/test/web-py/books/index.py/
Alias /test/web-py/wiki /var/www/example.com/test/web-py/wiki/index.py/
@jiceb
jiceb / gist:5280253
Created March 31, 2013 10:38
Downloading an Entire Web Site with wget
# http://www.linuxjournal.com/content/downloading-entire-web-site-wget
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \