Skip to content

Instantly share code, notes, and snippets.

@uniacid
uniacid / GoWithC.go
Last active September 2, 2015 11:41 — forked from 17twenty/GoWithC.go
Cross Compiling and Language Interop oh my!
package main
import (
"./binding"
"fmt"
)
func main() {
binding.PrintHello()
binding.Seed(1)
fmt.Println(binding.Random())
@uniacid
uniacid / python27_on_debian.sh
Created December 2, 2015 16:32 — forked from lukaslundgren/python27_on_debian.sh
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
#!/usr/bin/perl
#
# tracker_modify.pl 0.01
# Add/delete trackers recursively from all torrents.
# Free to copy and mutilate any way you like :)
#
# Originally from http://publicbt.com/tracker_modify.pl
sub usage {
print <<EOF
@uniacid
uniacid / autodl-irssi
Created January 13, 2017 18:48 — forked from phracker/autodl-irssi
A system init script for autodl-irssi
#!/bin/sh
# https://github.com/phracker
#
# AutoDL-Irssi Init Script
# Tested on Debian 7 (Wheezy)
# Instructions:
# - Install / configure irssi + autodl-irssi (duh)
# - Save this script as /etc/init.d/autodl-irssi
# - `chmod +x /etc/init.d/autodl-irssi`
# - `insserv autodl-irssi`
@uniacid
uniacid / Vagrantfile
Created March 3, 2017 20:19
Vagrant configuration file with OS detection - on windows we mount shared folders without NFS - on all other OS we use NFS for speeding up the project inside the virtual machine
# -*- mode: ruby -*-
# vi: set ft=ruby :
module OS
def OS.windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def OS.mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
#!/bin/bash -
export AWS_ACCESS_KEY=<your aws access key>
export AWS_SECRET_KEY=<your aws secret>
date_current=`date -u +%Y-%m-%d`
aws rds describe-db-snapshots --snapshot-type "automated" --db-instance-identifier <db_instance_name> | grep `date +%Y-%m-%d` | grep rds | tr -d '",' | awk '{ print $2 }' > /tmp/sandbox-snapshot.txt
snapshot_name=`cat /tmp/<db_instance_name>-snapshot.txt`
target_snapshot_name=`cat /tmp/<db_instance_name>-snapshot.txt | sed 's/rds://'`
@uniacid
uniacid / Magento_debug_controller_overrides.md
Created October 12, 2018 20:47 — forked from grafikchaos/Magento_debug_controller_overrides.md
Helpful debugging script for troubleshooting Magento overrides of controllers
@uniacid
uniacid / gist:54240f8bbd92cbf412a1dff0ecd9f2a3
Created February 8, 2019 01:53 — forked from nuria/celery_before_after.py
Handlers that execute right before and right after a task is executed in celery.
from celery import Celery
from celery.signals import after_task_publish,task_success,task_prerun,task_postrun
# first argument, current module
app = Celery('tasks')
app.config_from_object('celeryconfig')
# To instantiate celery and import this module
# do: celery -A task worker --loglevel=info
# after, once celery is running, instantiate a python console:
from paypalrestsdk.resource import List, Find, Create, Post, Update, Replace, Resource
from paypalrestsdk.api import default as default_api
import paypalrestsdk.util as util
from paypalrestsdk.exceptions import MissingParam
class Sale(Find, Post):
"""Sale class wrapping the REST v1/payments/sale endpoint
Usage::