Skip to content

Instantly share code, notes, and snippets.


Benjamin Altpeter baltpeter

View GitHub Profile
baltpeter / keybindings.json
Created Mar 3, 2020
VS Code keyboard shortcuts
View keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
"key": "ctrl+up",
"command": "-scrollLineUp",
baltpeter /
Created Jan 21, 2017
Create 100 files with random hex-like filenames and random binary content
for n in {1..100}; do
dd if=/dev/urandom of=$( cat /dev/urandom | tr -cd 'a-f0-9' | head -c 6 ) bs=1 count=$(( RANDOM + 1024 ))
baltpeter / config
Created Jul 10, 2015
Proxmox Reverse Proxy with Nginx
View config
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/ssl.crt;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
proxy_redirect off;
location / {

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 / domainchecker.php
Last active May 16, 2018
Reads a list of words and outputs those that are available as both .de and .com to the console
View domainchecker.php
header('Content-type: text/plain');
function checkdomain($domain) {
if($domain == '.com' OR $domain == '.de') return false;
$api_req = file_get_contents('' . $domain);
$api_req = json_decode($api_req, true);
return $api_req['available'] == 'true';
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") {
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