Skip to content

Instantly share code, notes, and snippets.

View calzoneman's full-sized avatar

Calvin Montgomery calzoneman

View GitHub Profile
@calzoneman
calzoneman / linux-flight-rules.md
Last active February 8, 2019 06:09
Miscellaneous solutions/reminders to problems I've encountered more than once

pip [for Python 3.2] throws UnicodeDecodeError on Debian Wheezy

Solution: export LANG=en_US.UTF-8

OpenVPN installation instructions

https://wiki.debian.org/OpenVPN

make-ovpn

[100, 10, 5, 1].sort() // -> [1, 10, 100, 5]
parseInt(0.0000007) // -> 7
parseInt('0.0000007') === parseInt('1e-7'); // -> false
[1, 2, 3, 4, 5].map(parseInt) // -> [1, NaN, NaN, NaN, NaN]
x = null
typeof x === 'object' // -> true
ip name
101.255.51.114 ALstNiEBQXki
101.255.51.114 BIGXvKEfqggr
101.255.51.114 ChYZoPGFegeQ
101.255.51.114 DBUTDQitdhUg
101.255.51.114 FmBKfPFmqsIf
101.255.51.114 FtAgxGZhJVrI
101.255.51.114 HQdFkLHnqrAS
101.255.51.114 KGsNrEbNQVov
101.255.51.114 mDXfCKhgkhOr
#!/bin/bash
npm install npm@3
deplist=`node -e 'p=require("./package");d=[];for(var n in p.dependencies)d.push(n+"@"+p.dependencies[n]);for(var n in p.devDependencies)d.push(n+"@"+p.devDependencies[n]);console.log(d.join(" "))'`
for dep in $deplist; do
echo "installing $dep"
./node_modules/npm/bin/npm-cli.js install $dep
done
./node_modules/npm/bin/npm-cli.js dedupe
./node_modules/npm/bin/npm-cli.js run postinstall
@calzoneman
calzoneman / termimg.c
Created January 13, 2018 07:54
Display images (in true color!) in a compatible terminal emulator using block characters
#include <gd.h>
#include <stdio.h>
#include <string.h>
void process(gdImagePtr img) {
for (int j = 0; j < img->sy/2; j++) {
for (int i = 0; i < img->sx; i++) {
int top = gdImageGetPixel(img, i, j*2 );
int bottom = gdImageGetPixel(img, i, j*2 + 1);