Skip to content

Instantly share code, notes, and snippets.

withakay / beatport-discog.rb
Last active Aug 29, 2015
Get your discography from beatport
View beatport-discog.rb
#!/usr/bin/env ruby
require "rubygems"
require "json"
require "net/http"
require "uri"
artist = "TR20"
uri = URI.parse("{artist}&sortBy=publishDate%20desc&perPage=150&url=releases")
withakay / gist:1339307
Created Nov 4, 2011
Update with inner join (SQL Server)
View gist:1339307
SET col = t2.col
FROM Table1 t1
INNER JOIN Table2 AS t2 ON t1.ID = t2.ID
withakay / gist:2507784
Created Apr 27, 2012
.ssh set permissions
View gist:2507784
// commands to run for your own user from you home directory after you have copied over the authorized_keys file
sudo chmod 600 ~/.ssh/authorized_keys
sudo chmod 700 ~/.ssh
sudo chown my_user_name:my_group_name ~/.ssh/authorized_keys
sudo chown my_user_name:my_group_name ~/.ssh
// commands to run for other users after copying over the authorized_keys file for that user
sudo chmod 600 ../some_other_user/.ssh/authorized_keys
View gist:c6630751a7e27cb6531e
Dropbox command-line interface
Note: use dropbox help <command> to view usage for a specific command.
status get current status of the dropboxd
throttle set bandwidth limits for Dropbox
help provide help
puburl get public url of a file in your dropbox's public folder
View sslfix.ps1
# Copyright 2014, Alexander Hass
# Version 1.4
# - RC4 has been disabled.
# Version 1.3
# - MD5 has been disabled.
# Version 1.2
# - Re-factored code style and output
# Version 1.1 - SSLv3 has been disabled. (Poodle attack protection)
View atom.xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="">
<title>Example Feed</title>
<subtitle>Insert witty or insightful remark here</subtitle>
<link href=""></link>
<name>John Doe</name>
#!/usr/bin/env bash
# A quick and dirty script to add one users groups to another
# Tested on Ubuntu 16.04
if [[ -z "$1" || -z "$2" ]]; then
echo "USAGE:"
echo " ./ <source_user> <dest_user>"
exit 0;
withakay /
Created Dec 11, 2017
Update authorized keys on remote server using known_hosts
#!/usr/bin/env bash
# Before running remember to generate a new key and update this script with the name (currently
awk -F'[ ,:]' '/^[0-9a-zA-Z]/{sub(/\[/,"",$1); sub(/\]/,"",$1); print $1}' ~/.ssh/known_hosts | uniq > _hosts
# A script to push a key to the only argument, a remote server.
while read h; do
echo "$h"
withakay /
Last active Jul 5, 2018 — forked from ringe/
KVM QCOW2 Live backup

Live backup of KVM virtual machines

This script will let you make backups of live VMs running on KVM, using libvirt.

The backup job will suspend the VM for the time it takes to copy the RAM to disk.

Credits: Luca Lazzeroni

Edited to detect and check the image format is qcow2 using qemu-img, rather than rely on the file extension being .qcow2

View doing.js
/* Usage
1. Run the setup function (you'll need to do this twice - 1st time to grant acces to Script Properties)
2. Share > Publish as service ... set security level and enable service
3. Copy the service URL and post this in your form/script action
4. Insert column names on the DATA sheet matching the parameter names of the data you are passing
call via https://your-script-url/exec?key=YOUR_KEY?headerX=123&headerB=xyz