Skip to content

Instantly share code, notes, and snippets.

View 0181532686cf4a31163be0bf3e6bb6732bf's full-sized avatar

Alex R 0181532686cf4a31163be0bf3e6bb6732bf

View GitHub Profile
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active May 16, 2024 23:31
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@Schnouki
Schnouki / popcorntime-vpn.sh
Last active January 20, 2024 12:07
OpenVPN for a single application using network namespaces -- helper scripts
#!/usr/bin/env zsh
# Initialize VPN
sudo vpnns up
sudo vpnns start_vpn
# Popcorn time!
sudo ip netns exec frootvpn sudo -u $USER popcorntime
# Cleanup
@nasser
nasser / gist:554f54ede7d0350db886
Created November 21, 2014 05:35
Compile LuaJIT for ARM
$ make HOST_CC="gcc -m32" CROSS=/Volumes/crosstools/x-tools/arm-kindle-linux-gnueabi/bin/arm-kindle-linux-gnueabi- TARGET_FLAGS="--sysroot /Volumes/crosstools/x-tools/arm-kindle-linux-gnueabi/arm-kindle-linux-gnueabi/sysroot -ldl" TARGET_SYS=Other
@wuhao5
wuhao5 / png_build.sh
Last active December 1, 2019 21:53
build libpng for iOS/MacOS X
rm -rf install_*
rm -rf output-*
# build simulator
./configure --prefix=`pwd`/install_i386 CFLAGS="-Ofast -mios-version-min=5.0" LDFLAGS="-flto" CC="xcrun -sdk iphonesimulator clang -arch i386"
make clean && make -j8 && make install
./configure --prefix=`pwd`/install_x86_64 CFLAGS="-Ofast -mios-version-min=5.0" LDFLAGS="-flto" CC="xcrun -sdk iphonesimulator clang -arch x86_64"
make clean && make -j8 && make install
@aras-p
aras-p / preprocessor_fun.h
Last active May 17, 2024 20:28
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@rogeliodh
rogeliodh / fetch_news.sh
Created January 4, 2012 14:34
[Bash] Script to fetch news with calibre
#!/bin/bash
# This is free and unencumbered shell script released into the public domain.
#
####################### Begin Customization Section #############################
#
# Name of the recipe to fetch. You can run:
# ebook-convert --list-recipes
# to look for the correct name. Do not forget the .recipe suffix
RECIPE="La Jornada (Mexico).recipe"