Skip to content

Instantly share code, notes, and snippets.

OS=[
ARCH="x86_64",
BOOT="network" ]
CPU="1"
MEMORY="768"
DISK=[
IMAGE="empty_10gb_disk" ]
NIC=[
@sekoyo
sekoyo / conduit.connect.js
Last active December 13, 2020 00:16
Connect to Phabricator with node.js
var Connect = function() {
this.fs = require('fs');
this.crypto = require('crypto');
this.http = require('http');
this.url = require('url');
this.q = require('q');
this.initialize();
};
#!/bin/bash
# Credits to https://gist.github.com/phette23/5270658 for inspiration
# https://superuser.com/a/599156
function setTabname {
echo -ne "\033]0;"$*"\007"
}
# set the title using above declared function and set the color of
@rafaeltuelho
rafaeltuelho / install-gosu-centos.md
Last active February 23, 2022 04:56
installing gosu on a centos docker box
# Install gosu.  https://github.com/tianon/gosu
ENV GOSU_VERSION=1.11
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
    && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc" \
    && gpg --verify /usr/local/bin/gosu.asc \
    && rm /usr/local/bin/gosu.asc \
    && rm -r /root/.gnupg/ \
 && chmod +x /usr/local/bin/gosu \
@wishfoundry
wishfoundry / gist:7036457
Last active April 1, 2022 05:18
Set OSX default text editor to sublime text 3 instead of TextEdit
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
@devicenull
devicenull / gist:3896763
Created October 16, 2012 01:25
Clonezilla Live iPXE config
:imaging
set image_name your-image-name
kernel http://${next-server}/tools/clonezilla-live/vmlinuz initrd=tools/clonezilla-live/initrd.img boot=live live-config noswap nolocales edd=on nomodeset ocs_daemonon="ssh" ocs_live_run="ocs-live-restore" ocs_live_extra_param="--batch -g auto -e1 auto -e2 -r -j2 -p reboot restoredisk ${image_name} sda" ocs_live_keymap="/usr/share/keymaps/i386/qwerty/us.kmap.gz" ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 nosplash fetch=http://${next-server}/tools/clonezilla-live/filesystem.squashfs ip=eth0:${netX/ip}:${netX/netmask}:${netX/gateway}:8.8.8.8 ocs_prerun="mount -t nfs ${next-server}:/home/partimag /home/partimag"
initrd http://${next-server}/tools/clonezilla-live/initrd.img
boot
@pablochacin
pablochacin / parse_query.sh
Last active January 27, 2023 01:32
A one liner to parse a http query string in bash
#
# the following one liner creates a shell variable from every parameter in a
# the query string in the variable QUERY, of the form p1=v1&p2=v2,... and sets it to
# the corresponding value so that parameters can be accessed by its name $p1, $p2, ...
#
for p in ${QUERY//&/ };do kvp=( ${p/=/ } ); k=${kvp[0]};v=${kvp[1]};eval $k=$v;done
@diyan
diyan / docker_buildx_kotlin_gradle.md
Created December 4, 2020 19:53
Gradle build time on AMD64 vs ARM64 using Docker multi-arch build feature

Gradle build time on AMD64 vs ARM64 using Docker multi-arch build feature

AMD64. docker buildx build --platform=linux/amd64 --tag=sample-app:amd64 .
ARM64. docker buildx build --platform=linux/arm64 --tag=sample-app:arm64 .

AMD64. An attempt to start the daemon took 1.883 secs.
ARM64. An attempt to start the daemon took 51.799 secs.

AMD64. :compileKotlin (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 25.839 secs.
@JamieMason
JamieMason / user.conf
Created August 3, 2012 07:40
Apache .conf to disable caching for localhost
<Directory "/Users/jdog/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/jdog/Sites/
@murdockcrc
murdockcrc / singleton.js
Created July 29, 2015 18:35
NodeJS Singleton pattern
exports = module.exports = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
return {