Skip to content

Instantly share code, notes, and snippets.

@MoritzBuetzer
MoritzBuetzer / migrate.sh
Last active January 8, 2019 08:27
Quick & dirty script to migrate Bitbucket Repo to GitHub
#!/usr/bin/env bash
projectname=$1
${bitbucketUsername}=HansMuster
${githubUsername}=HansMuster
git clone [email protected]:${bitbucketUsername}/${projectname}.git
cd ${projectname}
git remote set-url origin https://github.com/${githubUsername}/${projectname}.git
git push --mirror
@MoritzBuetzer
MoritzBuetzer / ssh
Last active January 28, 2021 08:24
Raspberry Pi headless ssh an wifi setup (both files in /boot/)
# just an empty file
@MoritzBuetzer
MoritzBuetzer / remove_passphrase.sh
Created July 7, 2017 08:08
Remove passphrase from ssh key
openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new
cp ~/.ssh/id_rsa ~/.ssh/id_rsa.backup
rm ~/.ssh/id_rsa
cp ~/.ssh/id_rsa_new ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa

Find Raspberry Pi in network with this snippet because all Pi MAC addresses starting with B8:27:EB.

$ sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

Source

@MoritzBuetzer
MoritzBuetzer / Placeholdit.sublime-snippet
Created October 12, 2016 07:43
Sublime Text snippet for placehold.it images
<snippet>
<content><![CDATA[
<img alt="${5:Placeholder}" title="${5:Placeholder}" src="//placehold.it/${1:350}x${2:200}/${3:D20000}/${4:FFFFFF}/">
]]></content>
<tabTrigger>placeholdit</tabTrigger>
</snippet>
@MoritzBuetzer
MoritzBuetzer / getdb.sh
Created July 11, 2016 07:30
Simple Script to dump remote db and import it local
#!/bin/sh
# Simple Script to dump remote db and import it local
# Usage: ./getdb.sh DBNAME
remoteHost=192.168.1.100
remotePw=testingtester
clear
echo "[Step 1/4] Get $1 DB"
@MoritzBuetzer
MoritzBuetzer / eclipse.ini
Created July 5, 2016 08:03
/Applications/Eclipse.app/Contents/Eclipse/
-clean
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
# download rar: http://www.win-rar.com/download.html
rar r sourcefile output
@MoritzBuetzer
MoritzBuetzer / utils.css
Created April 14, 2016 07:15
Vertical align center
.vertical-align-center {
display: -webkit-flex;
-webkit-flex-direction: column;
-webkit-justify-content: center;
display: flex;
flex-direction: column;
justify-content: center;
}
%d %30.30t %-5p [%-5marker] %45.45c - %m%n