Skip to content

Instantly share code, notes, and snippets.

@prashanthca
prashanthca / sourcesanspro.css
Last active August 29, 2015 14:22
Source Sans Pro
@font-face {
font-family: 'SSP';
src: url(data:font/truetype;charset=utf-8;base64,AAEAAAAUAQAABABAQkFTRYpzk38AAAFMAAAAUEZGVE1vgQZSAAABnAAAABxHREVGACcBDwAAAbgAAAAmR1BPU7HVmO0AAAHgAAAz7EdTVULkedueAAA1zAAAAa5PUy8yapOebQAAN3wAAABgY21hcBcJdWIAADfcAAAB4mN2dCAQnwrGAAA5wAAAACZmcGdtU7QvpwAAOegAAAJlZ2FzcAAAABAAADxQAAAACGdseWadjrCEAAA8WAAAmGRoZWFkCF5HpAAA1LwAAAA2aGhlYQ4TBlIAANT0AAAAJGhtdHirEk0zAADVGAAAA6Rsb2Nhah2OYgAA2LwAAAHUbWF4cAIGAbcAANqQAAAAIG5hbWUa6bs2AADasAAAJ+Bwb3N0on9KCwABApAAAALScHJlcOO155AAAQVkAAAAiHdlYmbH3VT5AAEF7AAAAAYAAQAAAAgAAAAEAA4AAmlkZW9yb21uAAJERkxUAA5sYXRuACQABgAAAAAAAQACAAgADAAB/qQAAQAAAAYAAAAAAAEAAgAIAAwAAf6kAAEAAAAAAAEAAAAA0MoNVwAAAADNl4CfAAAAANEfeFsAAQAAAAwAAAAWAB4AAgABAAEA6AABAAQAAAACAAAAAQAAAAEAAAAAAAEAAAAKAEYAaAACREZMVAAObGF0bgAcAAQAAAAA//8AAgAAAAEAFgADQVpFIAAWQ1JUIAAWVFJLIAAWAAD//wACAAAAAQACa2VybgAOc2l6ZQAUAAAAAQAAAAQAAABkAAAAAAAAAAAAAQAEAAIAAAACAAoBQgABARoABAAAAA0AJAAqAFQAZgCMAKYAsADCANwA4gDwAPoBDAABALIAIQAKABP/ngA6//QAPP/HAFr/ugBc/7YAcQAMAHr/2wCxABkAsgBCAOUAFwAEABP/mgA8/8cAXP/bAHEAIQ
@prashanthca
prashanthca / typekit.php
Last active August 29, 2015 14:23
Pull fonts from TypeKit
<?php
ini_set("display_errors","On");
error_reporting(E_ALL);
header("Content-type: application/json");
class TypekitFont
{
private $url,
$subset,
$format="otf",
@prashanthca
prashanthca / whitney.css
Created September 3, 2015 16:43
Whitney Stylesheet
@font-face {
font-family: 'Whitney';
font-style: normal;
font-weight: bold;
src: url(https://onedrive.live.com/download?resid=F87CD694B48033C9!114&authkey=!ADeQuq8LqQCrD3I&ithint=file%2cwoff) format('woff');
}
@font-face {
font-family: 'Whitney';
font-style: normal;
font-weight: normal;
curl -O http://imagemagick.org/download/ImageMagick-7.0.4-10.tar.xz
tar -xvf ImageMagick-7.0.4-10.tar.xz
cd ImageMagick-7.0.4-10
./configure
make
sudo make install
#!/bin/bash
# First argument: Client identifier
KEY_DIR=~/openvpn-ca/keys
OUTPUT_DIR=~/client-configs/files
BASE_CONFIG=~/client-configs/base.conf
cat ${BASE_CONFIG} \
<(echo -e '<ca>') \
@-moz-document domain("reddit.com") {
a.pretty-button, a.pretty-button.neutral, .big-mod-buttons .pretty-button, .link.spam, .comment.noncollapsed > .entry .usertext.border > .usertext-body, .users-online:before, .sidebox .spacer {
background: none;
}
.morelink, .morelink:hover, .flairselection > .linkflair > a:hover,
.flairselection > .flairremove > a:hover, .res .comment.noncollapsed > .entry.RES-keyNav-activeElement .md, .res .morerecursion > .entry.RES-keyNav-activeElement,
.res .morechildren > .entry.RES-keyNav-activeElement,
.res .comment.collapsed > .entry.RES-keyNav-activeElement, .res #RESDashboardAddComponent, .res.res-commentBoxes .comments-page .nestedlisting .comment, .res.res-commentBoxes .comments-page .nestedlisting .comment .comment, .res.res-commentBoxes .comments-page .nestedlisting .comment .comment .comment, .res.res-commentBoxes .comments-page .nestedlisting .comment .comment .comment .comment, .res.res-commentBoxes .comments-page .nestedlisting .comment .comment .comment
@prashanthca
prashanthca / get_ovpns.py
Created May 18, 2017 18:35
Get OVPN files from CSV
import csv, requests, base64, unicodedata
import os
from datetime import datetime
dt = datetime.utcnow()
# Temporary folder name
tmp_folder = str(dt.month)+str(dt.day)+str(dt.year)+'_'+str(dt.hour)+str(dt.minute)+str(dt.second)
# Create necessary folders
# Mount the installer image
hdiutil attach ./Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Mavericks.sparseimage
# Mount the sparse bundle for package addition
import requests,sys,re,md5
from bs4 import BeautifulSoup
url = sys.argv[1]
print(url)
fid = re.search("""http(.*?)cloudyfiles\.(.*?)\/(.*?)$""", url).group(3)
md5hash = md5.new()
md5hash.update(url)
md5hash.hexdigest()
/*
* smc_read.c: Written for Mac OS X 10.5. Compile as follows:
*
* gcc -Wall -o smc_read smc_read.c -framework IOKit
*/
#include <stdio.h>
#include <IOKit/IOKitLib.h>
typedef struct {