Skip to content

Instantly share code, notes, and snippets.

@jonforums
jonforums / uru_pathmunge.go
Last active December 19, 2015 16:54
new uru PATH handling
package main
import (
"errors"
"fmt"
"os"
"runtime"
"strings"
)
@jonforums
jonforums / ubuntu-nginx-cgit
Last active May 31, 2019 06:24
ubuntu server, nginx, and cgit via fcgiwrap+spawn-fcgi
# install nginx via your favorite method
...
# ensure primary nginx config file `/etc/nginx/nginx.conf` contains the following within
# the `http` block so that symlinked config from /etc/nginx/sites-available/* are included
include /etc/nginx/sites-enabled/*;
# install deps and build fcgiwrap
sudo aptitude install spawn-fcgi libfcgi-dev
curl -L -o fcgiwrap-1.1.0.tar.gz http://github.com/gnosek/fcgiwrap/archive/1.1.0.tar.gz
@jonforums
jonforums / chroot_sftp
Last active August 29, 2015 13:56
Chrooted SFTP users setup
# New SFTP users are chrooted by OpenSSH in their homes rooted at /srv/sdrop.
# Home directories are owned by root and not writeable by any other user. To
# allow SFTP users to upload files, an `uploads` subdir owned by the SFTP user
# is created in each user's home dir. Ensure /usr/sbin/nologin is listed in
# /etc/shells
sudo addgroup sftp
sudo useradd -s /usr/sbin/nologin -d /srv/sdrop/xfer -G sftp -M xfer
sudo passwd xfer
@jonforums
jonforums / arch.txt
Last active August 29, 2015 13:56
Arch and Ubuntu Server client VM increased console size
sudo vim /etc/default/grub
GRUB_GFXMODE=1024x768x24
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo vim /etc/vconsole.conf
KEYMAP='us'
FONT='Lat15-TerminusBold24x12'
# ensure Lat15-TerminusBold24x12 is in /usr/share/kbd/consolefonts
@jonforums
jonforums / Rakefile
Created January 16, 2014 02:17
rake cmd line task name alchemy
# Safe little monkey patch to Rake...until it isn't ;)
module Rake
class Application
def top_level_tasks=(tasks)
@top_level_tasks = tasks
end
end
end
puts 'Original top level tasks: %s' % Rake.application.top_level_tasks.inspect
@jonforums
jonforums / buildall.ps1
Last active December 21, 2015 07:48
Build Go from source using PowerShell
# Author: Jon Maken, All Rights Reserved
# License: 3-clause BSD
# Revision: 2014-04-05 17:44:19 -0600
$toolkit = 'C:\Apps\DevTools\msys32\mingw64\bin'
$targets = 'windows:amd64:1', 'windows:386:0',
'linux:amd64:0', 'linux:386:0',
'darwin:amd64:0', 'darwin:386:0'
$orig_path = $env:PATH
@jonforums
jonforums / uru_dirwalkup.go
Last active December 17, 2015 17:19
toying with uru's .ruby-version searching impl
package main
import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
)
@jonforums
jonforums / cl-winsdk-results
Last active December 17, 2015 07:08
mingw.org, mingw-w64, and winsdk handling of NET_LUID struct
C:\Users\Jon\Documents\CDev\sandbox>cl -W3 -Fenetluid.exe net_luid_test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
net_luid_test.c
net_luid_test.c(22) : warning C4101: 'luid' : unreferenced local variable
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:netluid.exe
@jonforums
jonforums / caca_de_jekyll.txt
Last active December 16, 2015 15:29
jekyll's wasting my time
I run a patched 0.11.2 jekyll environment (patched posix-spawn) on my local win7 box because of
breaking changes the devs made in the past that impact windows users. Hard to tell if they even
tested on windows boxes before pushing. Perhaps things are different with the recent commit activity.
And no time to confirm whether they're doing the right things for jekyll-on-windows users, or just
hoping all the recent commits for all the dependencies Just Work.
After a long hiatus, I just pushed a post (worked on my local 0.11.2 jekyll setup) about Go's
fantastic cross-build capabilities and was rewarded with this exciting email from GH:
@jonforums
jonforums / build_minised.ps1
Last active December 14, 2015 23:39
Automate building minised on Windows with mingw/mingw-w64
#requires -version 2.0
# Author: Jon Maken
# License: 3-clause BSD
# Revision: 2013-03-14 23:17:01 -0600
#
# TODO:
# - extract generics into a downloadable utils helper module
# - add proper try-catch-finally error handling