Skip to content

Instantly share code, notes, and snippets.

Christian Genco christiangenco

Block or report user

Report or block christiangenco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@christiangenco
christiangenco / download website assets
Created Jan 20, 2014
Use wget to download a website's assets, including images, css, javascript, and html. From http://www.linuxjournal.com/content/downloading-entire-web-site-wget
View download website assets
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
View download_egghead_videos.md
@christiangenco
christiangenco / How to bruteforce a TrueCrypt volume
Last active Jul 15, 2019
Brute force a TrueCrypt volume password with a known list on Mac OS X (works similarly on linux/ubuntu)
View How to bruteforce a TrueCrypt volume
# First you need to know the name of your TrueCrypt disk. In this example, after running the `diskutil list` command,
# you can see that my 2TB TrueCrypt disk is mounted at /dev/disk2, and the encrypted partition is named "disk2s1"
# (see the IDENTIFIER column). That's the name I need to use in the ruby script.
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage 250.1 GB disk0s2
View hash_array_to_csv.rb
class Array
def to_csv(csv_filename="hash.csv")
require 'csv'
CSV.open(csv_filename, "wb") do |csv|
csv << first.keys # adds the attributes name on the first line
self.each do |hash|
csv << hash.values
end
end
end
@christiangenco
christiangenco / parse_abcddb.rb
Created Jun 6, 2014
Get a csv from an Apple Address Book ".abbu" archive
View parse_abcddb.rb
require 'csv'
require 'pry'
# sqlite3 AddressBook-v22.abcddb
# .headers on
# .mode csv
# .output ZABCDPOSTALADDRESS.csv
# select * from ZABCDPOSTALADDRESS;
# .mode csv
# .output ZABCDRECORD.csv
@christiangenco
christiangenco / scrape_wikipedia_table.js
Created Nov 6, 2018
Download a wikipedia table as a .json file. Requires jquery and artoo.
View scrape_wikipedia_table.js
function tableToJson(table) {
var data = [];
// first row needs to be headers
var headers = [];
for (var i=0; i<table.rows[0].cells.length; i++) {
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,'');
}
// go through cells
@christiangenco
christiangenco / organize_mp3s.rb
Created Oct 18, 2018
Organize and rename a folder of mp3s by album and title
View organize_mp3s.rb
# usage:
# ruby organize_mp3s.rb /path/to/mp3/directory/
require 'shellwords'
def clean filename
return "" unless filename
filename.gsub(/[^0-9A-Za-z.\- ]/, '_')
end
@christiangenco
christiangenco / App.js
Created Jan 16, 2018
fbr.teachable.com "Delete A Document From The Firestore"
View App.js
import React, { Component } from "react";
import "./App.css";
import { db } from "./firebase";
window.db = db;
class App extends Component {
state = {
title: "Loading...",
@christiangenco
christiangenco / App.js
Last active Jan 16, 2018
fbr.teachable.com "Read Multiple Documents From The Firestore"
View App.js
import React, { Component } from "react";
import "./App.css";
import { db } from "./firebase";
window.db = db;
class App extends Component {
state = {
title: "Loading...",
@christiangenco
christiangenco / signup.html
Last active Dec 29, 2017
Bootstrap ajax email signup form for sendy.co
View signup.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js" ></script>
<title>AJAX Signup</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
You can’t perform that action at this time.