Skip to content

Instantly share code, notes, and snippets.

@FreddieOliveira
FreddieOliveira / docker.md
Last active May 5, 2024 13:30
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@PyYoshi
PyYoshi / _.md
Last active June 13, 2018 22:46
Disable Transparent Huge Pages on CoreOS
$ sudo -i
# vim /etc/systemd/system/disable-transparent-huge-pages.service
# systemctl enable disable-transparent-huge-pages
# systemctl start disable-transparent-huge-pages
# systemctl status disable-transparent-huge-pages
# cat /sys/kernel/mm/transparent_hugepage/enabled
# cat /sys/kernel/mm/transparent_hugepage/defrag
@brock
brock / pg_extract.sh
Last active April 22, 2024 11:00
Extract all databases (or one by name) from a sql file created by pg_dumpall
#!/bin/bash
# extract all postgres databases from a sql file created by pg_dumpall
# this script outputs one .sql file for each database in the original .sql file
# unless you pass the name of a database in the dump
if [ $# -lt 1 ]
then
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2
exit 1
fi
@creationix
creationix / init.lua
Last active November 1, 2019 11:13
Websocket server in nodemcu using new crypto module.
wifi.setmode(wifi.STATION)
wifi.sta.config("creationix","noderocks")
wifi.sta.connect()
tmr.alarm(0, 1000, 1, function ()
local ip = wifi.sta.getip()
if ip then
tmr.stop(0)
print(ip)
dofile("websocket.lc")
dofile("main.lc")
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@stefanozanella
stefanozanella / cnxsoft.md
Last active June 12, 2023 23:05
Emulate a Raspberry Pi with Qemu+ KVM

Booting with CNXSoft image

Reference: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/

curl -O https://dl.dropbox.com/u/45842273/2012-07-15-wheezy-raspian-minimal.img.7z

yum install p7zip
7za e 2012-07-15-wheezy-raspian-minimal.img.7z

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2012-07-15-wheezy-raspian-minimal.img -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
@clauswitt
clauswitt / distance.js
Created January 13, 2012 07:11
Get the distance between two (world) coordinates - a nodejs module
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */