View nvm lazy loading macOS zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nvm lazy loading to prevent zsh loading delays on macOS (inspired by @insidewhy) | |
# Add this to the end of your ~/.zshrc but make sure to remove all existing nvm.sh related code from ~/.zshrc first. | |
NVM_SH="" | |
# nvm.sh location depends on installation method | |
if [ -s "/usr/local/opt/nvm/nvm.sh" ]; then # Homebrew installer location | |
NVM_SH="/usr/local/opt/nvm/nvm.sh" | |
elif [ -s " ~/.nvm/nvm.sh" ]; then # Direct installer location | |
NVM_SH="~/.nvm/nvm.sh" | |
fi | |
if [ ! -z "$NVM_SH" ]; then |
View snmpd-silencer.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sed -i "s|-Lsd|-LS6d|" /lib/systemd/system/snmpd.service && systemctl daemon-reload && service snmpd restart |
View bcnode.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
lbtcbh () { | |
height=$(curl --silent https://blockchain.info/latestblock | jq .height | tr -d "\\n\"") | |
height=$((height-1)) | |
hash=$(curl --silent https://blockchain.info/block-height/$height?format=json | jq .blocks[0].hash | tr -d "\\n\"") | |
echo -n "$hash" | |
} | |
export BTC_BOOT_BLOCK=$(lbtcbh) | |
echo "Using $BTC_BOOT_BLOCK as previous BTC block hash" |
View create-windows-vm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Creates a Windows server KVM using LVM. | |
# Use ssh forwarding to access the VNC display to complete the Windows installation, like ssh example.host -L 56681:127.0.0.1:56681 | |
# Once connected with VNC, browse for the viostor driver | |
# | |
# In this example, both network bridges on the host will be available in the Windows VM. | |
# | |
NAME=desktop | |
RAM=4096 |
View result.log
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[33m[nodemon] 1.18.9[39m | |
[33m[nodemon] to restart at any time, enter `rs`[39m | |
[33m[nodemon] watching: *.*[39m | |
[32m[nodemon] starting `node ./app.js`[39m | |
count=1, timestamp=1/3/2019, 6:17:12 AM (EST), height=1851222, txCount=0, txsListSize=0, twsListSize=0, txFeeBase=0, txDistanceSumLimit=0, miner=0x069caa5b07f52dfad4b0a3bbee1bf956d65f908a | |
count=2, timestamp=1/3/2019, 6:17:25 AM (EST), height=1851223, txCount=0, txsListSize=0, twsListSize=0, txFeeBase=0, txDistanceSumLimit=0, miner=0x88f0e154482894387a3f8ba555da07b53382be58 | |
count=3, timestamp=1/3/2019, 6:17:43 AM (EST), height=1851224, txCount=0, txsListSize=0, twsListSize=0, txFeeBase=0, txDistanceSumLimit=0, miner=0x34d0c4b7f5f72690b441f6f6a50b6f81401cbdce | |
count=4, timestamp=1/3/2019, 6:17:45 AM (EST), height=1851225, txCount=0, txsListSize=0, twsListSize=0, txFeeBase=0, txDistanceSumLimit=0, miner=0x1bd4f5ebe0b44605204e8587cfed49086fbc07c6 | |
count=5, timestamp=1/3/2019, 6:18:05 AM (EST), height=1851226, txCount=0, txsListSize=0, twsListSize=0, txFeeBa |
View hostapd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface=wlan0 | |
logger_syslog=-1 | |
logger_syslog_level=2 | |
logger_stdout=-1 | |
logger_stdout_level=2 | |
ctrl_interface=/var/run/hostapd | |
ctrl_interface_group=0 | |
ssid=MyWIFIid | |
country_code=CH | |
hw_mode=a |
View modeswitch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sysctl net.ipv4.ip_forward=1 | |
sysctl net.ipv4.ip_default_ttl=65 | |
/usr/sbin/usb_modeswitch -v12d1 -p1f01 -J | |
sleep 5 | |
/sbin/dhclient -1 -v -pf /run/dhclient.eth3.pid -lf /var/lib/dhcp/dhclient.eth3.leases -I -df /var/lib/dhcp/dhclient6.eth3.leases eth3 | |
/sbin/iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE | |
/bin/systemctl restart hostapd | |
exit 0 |
View 10-sysinfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# 10-sysinfo - generate the system information | |
# Copyright (c) 2013 Nick Charlton | |
# | |
# Authors: Nick Charlton <hello@nickcharlton.net> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
View 00-header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 00-header - create the header of the MOTD | |
# Copyright (c) 2013 Nick Charlton | |
# Copyright (c) 2009-2010 Canonical Ltd. | |
# | |
# Authors: Nick Charlton <hello@nickcharlton.net> | |
# Dustin Kirkland <kirkland@canonical.com> | |
# | |
# This program is free software; you can redistribute it and/or modify |
View 20-updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# 20-updates - create the system updates section of the MOTD | |
# Copyright (c) 2013 Nick Charlton | |
# | |
# Authors: Nick Charlton <hello@nickcharlton.net> | |
# Based upon prior work by Dustin Kirkland and Michael Vogt. | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
NewerOlder