Skip to content

Instantly share code, notes, and snippets.

View kusor's full-sized avatar
💭
Positively happy

Pedro Palazón Candel kusor

💭
Positively happy
  • Joyent Inc.
  • Murcia (Spain)
  • X @kusor
View GitHub Profile
@kusor
kusor / README.md
Created December 2, 2020 19:59 — forked from mgerdts/README.md
Triton on Linux KVM

Triton on Linux KVM

I have a beefy Linux box that I use for development. One of the things this box does is run KVM instances that run a Triton headnode and several compute nodes.

Configuration

Networking

I have a single gigabit link to the outside world. All networks are able to reach the outside world via NAT.

@kusor
kusor / delete_git_submodule.md
Last active February 10, 2020 16:19 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule <name>"
  • Delete the now untracked submodule files `rm -rf path_to_submodule
@kusor
kusor / manual-sdcadm-self-update.sh
Created November 6, 2015 18:33 — forked from trentm/manual-sdcadm-self-update.sh
manual install of latest sdcadm (for https://joyent.com/triton)
updates-imgadm get-file -o latest-sdcadm.sh $(updates-imgadm list name=sdcadm --latest -H -o uuid)
bash latest-sdcadm.sh
@kusor
kusor / seattlejs.js
Created October 20, 2011 16:04 — forked from mcavage/seattlejs.js
Example of running ldapjs over the GitHub API
var fs = require('fs');
var ldap = require('ldapjs');
var log4js = require('log4js');
var GitHubApi = require("github").GitHubApi;
///--- Globals
@kusor
kusor / no.de.sh
Created October 9, 2010 06:43 — forked from isaacs/no.de.sh
no.de API command line client
#!/bin/bash
SERVER=https://api.no.de
SCRIPT="$0"
if [ ${SCRIPT:0:1} == "/" ]; then
SCRIPT="$(basename -- "$SCRIPT")"
fi
main () {
cmd=${1-help}
@kusor
kusor / info.txt
Created March 12, 2010 15:24 — forked from konobi/info.txt
# In .ssh/config:
Host *
ControlMaster no # Connections by default are not a master
ControlPath ~/.ssh/master-%r@%h:%p
ServerAliveInterval 60
ServerAliveCountMax 60
# On normal connections, if there is no master running on the ControlPath it will behave as normal
ssh some.host
@kusor
kusor / cron-test.js
Created December 20, 2009 10:14 — forked from onewland/cron-test.js
simple cron API for node.js
var cron = require('./cron'), sys = require('sys');
cron.Every((2).seconds(), function() { sys.puts('Working!'); });
commit 7fba8f5e4978b2ff990304f7150918f1cc0eea74
Author: Aman Gupta <aman@tmm1.net>
Date: Fri Mar 27 13:51:30 2009 -0700
dtrace patch for 1.8.7 (run autoconf, then ./configure --disable-pthread --enable-dtrace --prefix=/opt/ruby-dtrace)
diff --git a/Makefile.in b/Makefile.in
index a37bcf6..604bfed 100644
--- a/Makefile.in
+++ b/Makefile.in
@kusor
kusor / gist:229816
Created November 9, 2009 09:07 — forked from tmm1/gist:89588
require 'rubygems'
require 'eventmachine'
module ChatClient
def self.list
@list ||= []
end
def post_init
@name = "anonymous_#{rand(99999)}"
# :PUBLISHER: markdown, shell, { command: 'rdiscount' }
# :BRACKET_CODE: '[ruby]', '[/ruby]'
# :TEXT:
#
# Have you ever started a long operation and walked away from the computer, and
# come back half an hour later only to find that the process is hung up waiting
# for some user input? It's a sub-optimal user experience, and in many cases it
# can be avoided by having the program choose a default if the user doesn't
# respond within a certain amount of time. One example of this UI technique in
# the wild is powering off your computer - most modern operating systems will