Skip to content

Instantly share code, notes, and snippets.

View bennyfactor's full-sized avatar

Benjamin Lamb bennyfactor

  • Trabian Technology
  • INDPLS IN US NA
View GitHub Profile
@blais
blais / apt-tree
Last active July 7, 2023 03:22
apt-tree
#!/usr/bin/env python3
"""Display a graph of dependencies between Ubuntu packages.
Reads a list of packages from either a file or stdin.
Outputs a PDF.
"""
__author__ = "Martin Blais <blais@furius.ca>"
import argparse
import logging
import random
@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
@yatsu
yatsu / rbenv-ruby187-macos.sh
Last active July 13, 2023 19:36
Install ruby-1.8.7 with rbenv on macOS Catalina (10.15)
#!/bin/sh
# 1) Install Xcode 11
# 2) Install command line tools: `xcode-select --install`
# 3) Install HomeBrew
# 4) brew tap cartr/qt4 && brew install cartr/qt4/openssl@1.0 subversion rbenv
# 5) Setup rbenv
# 6) Run this command
PKG_CONFIG_PATH="$(brew --prefix cartr/qt4/openssl@1.0)/lib/pkgconfig" \
@whitehat101
whitehat101 / 1.8.7-p352-on-sierra.md
Created December 8, 2016 02:19
Installing 1.8.7-p352 on macOS Sierra 10.11 with openssl

Installing 1.8.7-p352 on macOS Sierra 10.11 with openssl

See https://github.com/rbenv/ruby-build/wiki

Assuming rbenv and ruby-build already setup

brew install openssl libyaml libffi readline
# required for building Ruby <= 1.9.3-p0:
brew tap homebrew/dupes &amp;&amp; brew install apple-gcc42
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@olpoco
olpoco / fedora.md
Last active March 3, 2018 10:24
Installing Fedora 23 on Macbook Pro Retina 2016, and attaching Airport Extreme

Installing Fedora on Macbook Pro retina

  1. Download Fedora 23 iso, create a usb bootable media Follow instructions here Basically,
  2. use diskutil list to figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is /dev/disk2
  3. umount the disk using diskutil unmountDisk /dev/disk2 or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether)
  4. use dd(a low level cp) to write iso content into the usb drive, sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/disk2 bs=1m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time)
  5. use Disk Utility to shrink Mac's harddrive
@jbraithwaite
jbraithwaite / shipitfile.js
Created August 28, 2015 07:27
Shipit deploy with Slack integration
var pack = require('./package.json');
var request = require('request');
var name = pack.name;
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
var deployTo = '/var/www/FOLDER_TO_DEPLOY_TO';
var deployToCurrent = deployTo + '/current';
var slackWebhookURL = 'SLACK_HOOK_URL';
@shamil
shamil / mount_qcow2.md
Last active May 3, 2024 06:35
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@yuuan
yuuan / centos.conf
Created April 3, 2014 02:04
Config file for CentOS 6.5 on coLinux.
#
# This is an example for a configuration file that can
# be passed to colinux-daemon in this manner:
#
# colinux-daemon @example.conf
#
# Note that you can still prepend or append configuration and
# boot parameters before and after '@', or you can use more
# that one '@ to load several settings one after another.
#
@hlung
hlung / How to connect a PS3 controller.md
Last active March 25, 2024 14:45
How to connect PS3 controller on Mac OSX, PC

How to connect PS3 controller on Mac OSX, PC, etc.

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps: