Skip to content

Instantly share code, notes, and snippets.

View florianbeer's full-sized avatar

Florian Beer florianbeer

View GitHub Profile
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
anonymous
anonymous / IRC client in pure bash 4
Created March 28, 2016 16:57
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@Nihisil
Nihisil / jail.local
Last active September 5, 2023 06:20
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
@EvilGrinUK
EvilGrinUK / lvm_backup.sh
Last active August 13, 2019 08:33
LVM Snapshot Backup - Takes a snapshot of each logical volume in a volume group and creates a compressed dd copy in a specific directory.
#!/bin/bash
VG_NAME="vg0"
SNAPSHOT_SIZE="+2G"
BACKUP_LOCATION="/backups"
DAYSTOKEEP=7
for lv in $(lvs --noheadings --nosuffix --aligned --separator , -o lv_name,lv_attr | grep -v ,s | cut -d, -f1)
do
LV_SIZE="$(lvs --units m --noheadings --nosuffix --aligned --separator , -o lv_name,lv_size | grep "$lv" | cut -d',' -f2 | cut -d. -f 1)" # LV size in MB