Skip to content

Instantly share code, notes, and snippets.

View alexfornuto's full-sized avatar
🏠
Writing Docs

Alex Fornuto alexfornuto

🏠
Writing Docs
View GitHub Profile
@alexfornuto
alexfornuto / gist:35b8ca4275fbf7002c59
Last active August 29, 2015 14:09
addAlphaDir.sh
#!/bin/bash
echo "Please provide the full path to the directory to organize: "
read path
touch ~/.addAlphaDir
while read -r ~/.addAlphaDir
do
@alexfornuto
alexfornuto / gist:12dcc0c161c1ba78792b
Last active August 29, 2015 14:06 — forked from illblew/gist:8884b405bd5d90db4d4d
Might be something someday
#!/usr/bin/python
import socket
import sys
import mysqldb
server = "irc.swiftirc.net" #settings
channel = "#pxlbin"
botnick = "pxlboat"
#db jazzy
@alexfornuto
alexfornuto / first.sh
Last active October 5, 2015 22:48
bash-setup-init - Debian Style
#!/bin/bash
echo -e "updating the timezone... \n"
sudo cp /usr/share/zoneinfo/America/New_York /etc/localtime
sleep 1
echo -e "Updating, upgrading, installing packages... \n"
sudo apt-get update
sudo apt-get upgrade -y
@alexfornuto
alexfornuto / matrix.sh
Last active May 21, 2025 18:28
Matrix Bash Script
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"
@alexfornuto
alexfornuto / swapclear.sh
Last active August 29, 2015 13:59
Swapclear.sh
#!/bin/bash
meminfo=($(tr '\n' ' ' < /proc/meminfo))
# MemFree Buffers Caches SwapTotal SwapFree
if [ $(( ${meminfo[4]} + ${meminfo[7]} + ${meminfo[10]} )) -gt $(( ${meminfo[52]} - ${meminfo[55]} )) ]; then
sudo swapoff -a;
sudo swapon -a;
echo "Flushed Swap"
else
echo "Nothing to do here"