Skip to content

Instantly share code, notes, and snippets.

@mcpherrinm
mcpherrinm / instructions.md
Last active October 25, 2015 02:35
Crosscompiling Rust to Arm

I want to write Rust code on my computer (x86_64, Ubuntu 14.04) and produce arm executables. I found hints on the internet, but not a concise set of instructions on what to do. So I wrote them down exactly:

apt-get install g++-arm-linux-gnueabihf
git clone https://github.com/mozilla/rust.git
mkdir rust/build-cross
cd rust/build-cross
../configure --target=arm-unknown-linux-gnueabihf --prefix=$HOME/local/rust-cross
make -j8 && make install
@braitsch
braitsch / Git Purge
Last active February 18, 2022 16:17
Bash script to nuke unwanted files from the history of a git repository
# Bash script to nuke unwanted files from the history of a git repository
# Modification of David Underhill's script http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
# http://stackoverflow.com/questions/2100907/how-do-i-purge-a-huge-file-from-commits-in-git-history
# usage : execute from repository root ./git-purge.sh "path to unwanted files"
#!/bin/bash
set -o errexit
if [ $# -eq 0 ]; then
@Elemecca
Elemecca / hex_dump.lua
Created August 28, 2013 03:37
Lua function which creates a hex dump of a binary string.
function hex_dump (str)
local len = string.len( str )
local dump = ""
local hex = ""
local asc = ""
for i = 1, len do
if 1 == i % 8 then
dump = dump .. hex .. asc .. "\n"
hex = string.format( "%04x: ", i - 1 )
@wankdanker
wankdanker / ksmstat
Created September 9, 2011 18:12
bash script to calculate ksm stats in kb
#!/bin/bash
if [ "$1" != "" ]; then
echo "
----------------------------------------------------------------------------
http://www.kernel.org/doc/Documentation/vm/ksm.txt :
The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/:
@cpinto
cpinto / hacked up ntlm proxy tunnel
Created July 28, 2009 12:04
I use this program to wrap putty, which doesn't support NTLM auth, setting the proxy type to telnet and create a SOCKS proxy to a remote SSH server.
package ntlmptunnel;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.NTCredentials;