Skip to content

Instantly share code, notes, and snippets.

;; On X11, change the pointer to an arrow
(if (boundp 'x-pointer-arrow)
(progn
(setq-default x-pointer-shape x-pointer-arrow)
;; hack to force the pointer shape to change
(set-mouse-color "black")))
;; Lisp setup
(require 'cl)
(add-to-list 'load-path "~/.emacs.d")
;; Keep customizations in a separate file
(setq custom-file "~/.emacs.d/emacs-custom.el")
(load custom-file 'noerror)
;; Manual customizations
(blink-cursor-mode nil)
" \t tabs
set expandtab
set smartindent
set smarttab
set tabstop=8
set shiftwidth=4
# svscan - daemontools
#
# This service starts daemontools from the point the system is
# started until it is shut down again.
start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
#!/bin/sh
exec 2>&1
exec /usr/local/sbin/nginx -c ./nginx.conf
#!/bin/sh
export PATH=/usr/local/bin:$PATH
exec multilog t ./main
parted /dev/sdX
mklabel
# type "gpt" when it asks for "New disk label type?"
mkpart ext4 0 100%
quit
#!/bin/sh
xxd -r -ps <<EOF | gunzip -c > reconstituted
1f8b08086b8f6f4a0003776f726c646f6e6c696e655f322e76636c00bd56
ff6fda4614ffdd7fc5eb31b54d156c0c896803a46a13b676ead26865cb26
4d8a0efbb0af9c7ddedd398404f6b7ef9d8d01d3244a26ad462073f7be7c
def7d7804f3f5f48254218d360cad2503bceea0dc4d799bdb91452316328
dc3a808f1b4b6d6000a47de0faf6eb1e925e79934955dcbc6ead4f941c33
3c2a598b23c5fece9995b03eb20ff97c3efaf8f9ec0bbc820fa3d1b9e7bb
3ea9137c40b547309bcddaee0a981bc86487e844a6290b0c97e91104426a
from math import sqrt
# Set up the array
m = 2000000
nums = range(m)
nums[1] = 0
i = 0
while i**2 < m:
if nums[i] == 0:
from math import sqrt
primes = [2]
i = 1
while len(primes) < 10001:
i += 2
I = sqrt(i)
prime = True
for p in primes: