Skip to content

Instantly share code, notes, and snippets.

@smgt
smgt / osx.txt
Created August 1, 2012 15:10
List of OSX settings
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MacBook Pro"
scutil --set HostName "MacBook Pro"
scutil --set LocalHostName "MacBook-Pro"
# Menu bar: disable transparency
@francisbyrne
francisbyrne / chmodr.sh
Created September 16, 2012 07:54
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active April 9, 2025 20:20
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@juanique
juanique / git-add-key.sh
Last active November 2, 2024 05:49
Bash script to add a new SSH key to your GitHub account
rm -rf ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
read -p "Enter github email : " email
echo "Using email $email"
ssh-keygen -t rsa -b 4096 -C "$email"
ssh-add ~/.ssh/id_rsa
pub=`cat ~/.ssh/id_rsa.pub`
read -p "Enter github username: " githubuser
echo "Using username $githubuser"
read -s -p "Enter github password for user $githubuser: " githubpass
curl -u "$githubuser:$githubpass" -X POST -d "{\"title\":\"`hostname`\",\"key\":\"$pub\"}" https://api.github.com/user/keys
@unix2xp
unix2xp / ubuntu_initialize_script.sh
Last active December 23, 2023 18:11
OS: Ubuntu: Setup script
alias aptg='sudo apt-get install -y'
alias aptr="sudo apt-get remove --purge'
sudo apt-get install -y gnome-shell
sudo apt-get remove --purge totem -y
sudo apt-get install -y tilda gnome-do gnome-tweak-tool compizconfig-settings-manager proxychains vim smplayer nautilus-open-terminal
sudo apt-get autoremove --purge indicator-messages*
sudo apt-get autoremove --purge telepathy-indicator
# configurations
@jbgo
jbgo / free-space-on-boot-disk.md
Last active April 3, 2025 19:21
Free up space on /boot disk (ubuntu)

Free disk space when /boot is full (Ubuntu)

TL;DR

dpkg -l linux-image*
uname -r
sudo apt-get remove linux-image-2.6.32-{21,37,38,39,40,41,42,43,44}-server
sudo apt-get autoremove
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@bcap
bcap / start-stop-daemon-template
Last active July 21, 2023 11:12
Template file for creating linux services out of executables using the start-stop-daemon
#!/bin/bash
### BEGIN INIT INFO
# Provides: <service name>
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: <service description>
### END INIT INFO
@yourdesigncoza
yourdesigncoza / firewall-ufw
Created April 30, 2013 15:52
UFW - Uncomplicated Firewall
# The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall.
# resources
# https://wiki.ubuntu.com/UncomplicatedFirewall
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh [email protected] where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial :::
# Enable and configure Firewall - ufw
# ufw firewall is installed by default on Ubuntu 12.04. gufw is a handy GUI frontends for ufw to manage the firewall.
@atenni
atenni / README.md
Last active July 15, 2025 12:37
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]