Skip to content

Instantly share code, notes, and snippets.

View xnox's full-sized avatar

Dimitri John Ledkov xnox

View GitHub Profile
#!/usr/bin/python
#
# use avahi to find a _apt_proxy._tcp provider and return
# a http proxy string suitable for apt
import socket
from subprocess import Popen, PIPE
def is_ipv6(a):
package main
import "fmt"
func split(sum int) (x, y int) {
x = sum * 4 / 9
y = sum - x
return
}
@xnox
xnox / lpshell
Last active August 29, 2015 14:03
In [1]: lp
Out[1]: <launchpadlib.launchpad.Launchpad at 0x7f49ecc649b0>
In [2]: lp.distributions
Out[2]: <launchpadlib.launchpad.DistributionSet at 0x7f49ddf0e630>
In [3]: lp.distributions['ubuntu']
Out[3]: <distribution at https://api.launchpad.net/1.0/ubuntu>
In [4]: lp.distributions['ubuntu'].display_name
@xnox
xnox / second
Last active August 29, 2015 14:07
console colors
##source http://unix.stackexchange.com/questions/73807/change-colors-in-console-virtual-terminal
/sys/module/vt/parameters/default_red
/sys/module/vt/parameters/default_grn
/sys/module/vt/parameters/default_blu
clr () {
clear # GFX bug otherwise
setterm -regtabs 4
Color_names="bla red gre yel blu mag cya whi"

Keybase proof

I hereby claim:

  • I am xnox on github.
  • I am xnox (https://keybase.io/xnox) on keybase.
  • I have a public key ASBvjajfbjsKg63UPOO7h6gvXKlFb4Jr_mQX1DNPwI0q3go

To claim this, I am signing this object: