Skip to content

Instantly share code, notes, and snippets.

Benjamin Altpeter baltpeter

Block or report user

Report or block baltpeter

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
baltpeter / checkdomain.php
Last active Aug 29, 2015
Use to check whether a domain is available as both .de and .com
View checkdomain.php
function checkdomain($domain) {
$api_req = file_get_contents('' . $domain);
$api_req = json_decode($api_req, true);
if($api_req['available'] == 'true') return true;
return false;
baltpeter / treetagger.js
Last active Aug 29, 2015
Given a plain text wordlist, output all words from that list that are nouns
View treetagger.js
var Treetagger = require('treetagger');
var tagger = new Treetagger({ language: "french" });
var fs = require('fs'), filename = "/Users/benni/coding/tt-nodejs/french.txt";
fs.readFile(filename, 'utf8', function(err, data) {
if(err) throw err;
tagger.tag(data, function (err, results) {
results.forEach(function(e) {
if(e.pos == "NOM") {

Keybase proof

I hereby claim:

  • I am baltpeter on github.
  • I am baltpeter ( on keybase.
  • I have a public key whose fingerprint is 0903 DEF9 C683 8D77 4EC7 3A8E 580B 1C78 00EB 2372

To claim this, I am signing this object:

baltpeter /
Created Nov 6, 2014
Format 2 TB+ disks using parted (GPT)
# To create a partition start GNU parted as follows:
parted /dev/sdb
# Create a new GPT disklabel i.e. partition table:
mklabel gpt
# Next, set the default unit to TB, enter:
unit TB
baltpeter /
Created Nov 4, 2014
Replace all occurrences of `wrong` with `right` in all files matching `*.txt` in a directory
sed -i '' 's/wrong/right/g' *.txt
baltpeter /
Created Jun 1, 2014
Configure Debian/Ubuntu to use static IP instead of DHCP
nano /etc/network/interfaces
iface eth0 inet static
/etc/init.d/networking restart
baltpeter / UIImage_from_color
Created May 3, 2014
Create UIImage rectangle from color
View UIImage_from_color
+ (UIImage *)imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0, 0, 1, 1);
// Create a 1 by 1 pixel context
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
[color setFill];
UIRectFill(rect); // Fill it with your color
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
return image;
baltpeter / UIColor_NSLog
Created May 3, 2014
Use NSLog to output a UIColor
View UIColor_NSLog
CGFloat red, green, blue, alpha;
[color getRed: &red
green: &green
blue: &blue
alpha: &alpha];
NSLog(@"red = %f. Green = %f. Blue = %f. Alpha = %f",
baltpeter /
Created Apr 27, 2014
Format and mount new hard drive
#1. Figure out the device name for the new device
fdisk -l
#This will give you output similar to this:
#Disk /dev/sda: 17.2 GB, 17179869184 bytes
#255 heads, 63 sectors/track, 2088 cylinders, total 33554432 sectors
#Units = sectors of 1 * 512 = 512 bytes
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
find /path/here -name "what to look for"
You can’t perform that action at this time.