Skip to content

Instantly share code, notes, and snippets.

set nu autoindent tabstop=4 expandtab shiftwidth=4
@alsanchez
alsanchez / install_busybox.sh
Created November 23, 2015 09:42
Install busybox on the x86 Android emulator
#!/bin/bash
wget "http://www.busybox.net/downloads/binaries/latest/busybox-i486" -O /tmp/busybox
adb push /tmp/busybox /data/data/busybox
adb shell "mount -o remount,rw /system && mv /data/data/busybox /system/bin/busybox && chmod 755 /system/bin/busybox && /system/bin/busybox --install /system/bin"
import re
from anki import Collection
from anki.media import MediaManager
regex = re.compile(u"\[sound:[^\]]+]")
col = Collection("<collection-path>.anki2")
mm = MediaManager(col, None)
ids = col.findCards("deck:<deck-name>")
for id in ids:
card = col.getCard(id)
package com.company;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
package com.company;
import java.lang.reflect.Array;
import java.security.MessageDigest;
import java.util.*;
public class Main {
public static void main(String[] args) {
List<Cell> todas = new ArrayList<Cell>();
@alsanchez
alsanchez / suphp_permissions.sh
Last active September 23, 2015 10:01
fix permissions for suphp
#!/bin/sh
find -type d -print -exec chmod 755 {} \; && find -type f -print -exec chmod 644 {} \;
@alsanchez
alsanchez / ovh_network_configuration.sh
Last active August 29, 2015 14:04
Generate /etc/network/interfaces for your OVH virtual machines
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <dedicated-server-ip> <virtual-machine-ip>"
exit 1
fi
GATEWAY=`echo $1 | awk -F . '{print $1"."$2"."$3".254"}'`
IP="$2"