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
@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;
@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
@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/:
@ruario
ruario / h264-vivaldi-linux.md
Last active March 18, 2023 11:17
How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library
@ScribbleGhost
ScribbleGhost / Windows 10 English with Norwegian keyboard.ps1
Last active July 29, 2023 14:28
Keep Windows 10 display language English but set all regional settings to Norwegian including keyboard input
# Set WinUserLanguageList as a variable
$lang = Get-WinUserLanguageList
# Clear the WinUserLanguageList
$lang.Clear()
# Add language to the language list
$lang.add("en-US")
# Remove whatever input method is present
$lang[0].InputMethodTips.Clear()
# Add this keyboard as keyboard language
$lang[0].InputMethodTips.Add('0409:00000414')
@lg
lg / angry_wifi.sh
Last active November 28, 2023 23:56
auto disconnects clients with a low signal strength on LEDE / OpenWRT
#!/bin/ash
#
# angry_wifi.sh
#
# auto disconnects clients with a low signal strength on LEDE / OpenWRT. great
# for clients who hold onto a lower-signal-strength accesspoint instead of
# roaming. before running, make sure to download the latest MAC addresses with:
#
# wget --no-check-certificate -O - 'https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=apple' | cut -d, -f2 > apple_mac_addresses
#
@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 )
@Fuwn
Fuwn / force-install-steam.bat
Last active January 8, 2024 16:44
A simple Batch script to force install Steam without administrator permissions on Windows
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "SteamSetup.exe"
@Arano-kai
Arano-kai / duperemove-weekly@.timer
Last active January 22, 2024 20:36
SystemD service and timer templates for duperemove.
[Unit]
# Usage: systemctl enable --now duperemove-weekly@$(systemd-escape <path>).timer
# Utilize %J specifier for duration set.
# One can hardlink/copy with 'weekly' part changed
# to set other duration.
Description=Deduplicate %I at calendar event (%J)
After=local-fs.target
Requires=local-fs.target
Conflicts=shutdown.target rescue.target rescue.service emergency.service