Skip to content

Instantly share code, notes, and snippets.

View Cloudxtreme's full-sized avatar

Kevin Hatfield Cloudxtreme

  • CloudCDN
View GitHub Profile
@jj1bdx
jj1bdx / freebsd-macOS-stm32-dev.md
Last active May 22, 2022 08:40
FreeBSD and macOS STM32 embedded development kit configuration

FreeBSD and macOS STM32 development memo

FreeBSD Ports needed

  • devel/gcc-arm-embedded (Add path to /usr/local/gcc-arm-embedded-6-2017-q2-update/bin)
  • devel/stlink
  • comms/dfu-util
  • devel/openocd
  • devel/libftdi (as a dependency)
@gjpalau
gjpalau / defaultuser-prep.sh
Created July 20, 2015 21:57
script to prepare a default user before capturing an image
#!/bin/bash
\#
\# defaultuser-prep.sh
\# preparer for default user account on Mac OS X
\#
/bin/rm –rf /System/Library/User\ Template/English.lproj
if [ -d "/Users/default/Library/Keychains" ]; then
/bin/rm -rf /Users/default/Library/Keychains
fi
/bin/mkdir /Users/default/Library/Keychains
@gjpalau
gjpalau / ipv6-off.sh
Created July 20, 2015 21:08
turn off IPv6 on OS X via Script
#!/bin/sh
\#
\# ipv6-off.sh
\# Disable IPv6 on all interfaces.
\#
IFS=$'\n'
net=`networksetup -listallnetworkservices | grep -v asterisk`
for i in $net
do
networksetup -setv6off "$i"
@bruienne
bruienne / xhyverun.sh
Last active October 22, 2025 14:54
xhyve boot2docker sample config
#!/bin/sh
KERNEL="/path/to/vmlinuz64"
INITRD="/path/to/initrd.img"
#CMDLINE="earlyprintk=serial console=ttyS0 acpi=off"
CMDLINE="loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10:LABEL=boot2docker-data base"
MEM="-m 1G"
#SMP="-c 2"
NET="-s 2:0,virtio-net,en0"
@gjpalau
gjpalau / rsync-capture.sh
Created May 14, 2015 00:07
Rsync Capture
# !/bin/bash
# RSYNC Capture
# Carlos Raygada / Gilbert Palau
# May 2015 v.01
#Stores Mac Serial Number in $serial
serial=$(ioreg -l |grep "IOPlatformSerialNumber"|cut -d ""="" -f 2|sed -e s/[^[:alnum:]]//g)
#Stores Username
echo enter username:
@gjpalau
gjpalau / disableipv6.sh
Created April 1, 2015 15:05
Disable IPv6 on all network devices on os x
#!/bin/sh
IFS=$'\n'
net=`networksetup -listallnetworkservices | grep -v asterisk`
for i in $net
do
networksetup -setv6off "$i"
done
exit 0
@gjpalau
gjpalau / install-sophos-noconsole.sh
Created March 24, 2015 13:46
Install Sophos - Without the Console
#!/bin/bash
LOGGER="/usr/bin/logger"
# Determine working directory
install_dir=`dirname $0`
# Uninstall existing copy of Sophos 8.x by checking for the
# Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
# If present, the uninstallation process is run.
@cknave
cknave / caenons3.md
Created March 21, 2015 18:01
Camlistore Encryption on S3

Camlistore Encryption on S3

Here's what I found out while setting up Camlistore to sync encrypted blobs to Amazon S3. This works for me, but I'm new to Camlistore so this might not be the best way to do it.

Amazon S3 Config

The encryption handler requires two buckets, one for metadata and one for blobs. In this example, I've created two buckets called my-camlistore-meta and my-camlistore-blob.

@gjpalau
gjpalau / TurnOnSSHAddAdminGroup.sh
Last active July 22, 2016 08:20
Turn on remote login ## Create the com.apple.access_ssh group ## Add the admin group to com.apple.access_ssh ## unload and load the SSH Service
#!/bin/bash
# TurnOnSSHAddAdminGroup.sh
#
# Turn on remote login ## Create the com.apple.access_ssh group ## Add the admin group to com.apple.access_ssh ## unload and load the SSH Service
sudo systemsetup -setremotelogin on && dseditgroup -o create -q com.apple.access_ssh && dseditgroup -o edit -a admin -t group com.apple.access_ssh && sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist && sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers && sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users techserv -activate -access -on -privs -all -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw p@55w0rd -quiet
/usr/libexec/PlistBuddy -c ‘Set :com.apple.screensharing:Disabled NO’ /private/var/db/launchd.db/com.apple.launchd/overrides.plist
@gjpalau
gjpalau / timezone.sh
Created March 4, 2015 15:49
Script for managing timezones
#!/bin/bash
#### Set NTP Server
# Sets correct Timezone. If no Timezone is set, then default is CST
timezone=$1
if [ "$timezone" = "CST" ]
then
echo "America/Chicago"