Skip to content

Instantly share code, notes, and snippets.

@BlkPingu
BlkPingu / newjp.sh
Last active April 22, 2023 21:05
Create new jupyter notebook
// put this in your .bash_rc or .zshrc to create a new jupyter notebook at your current location
// use: newjp yournotebookname
// creates yournotebookname.ipynb
newjp() {
touch $(pwd)/$1.ipynb
echo "{\"cells\": [],\"metadata\": {},\"nbformat\": 4,\"nbformat_minor\": 2}" > $(pwd)/$1.ipynb
}
@BlkPingu
BlkPingu / remove_pdf_passwords.txt
Last active February 19, 2022 16:22
Remove Passwords from all PDF in folder
// single pdf
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=uncrypted.pdf -c .setpdfwrite -f target.pdf
// all pdf in folder
mkdir ../uncrypted && find . -type f -name "*.pdf" -exec gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=../uncrypted/{} -c .setpdfwrite -f {} \;
@BlkPingu
BlkPingu / README.md
Created January 20, 2022 15:00
HTW Berlin Cisco any connect script

How to

  1. Install anyconnect command line tools
  2. Save vpn_htw.sh somewhere, like ~/.scripts
  3. put a new Alias in your .bashrc or .zshrc alias htw="sudo bash ~/.scripts/vpn_htw.sh"
  4. Fill out your credentials in the vpn_htw.sh where commented
  5. Source your rc file like source .bashrc
  6. launch with htw -c
@BlkPingu
BlkPingu / cisco_htw.sh
Last active May 14, 2020 10:02
Connect to HTW Berlin VPN via cisco CLI
#!/bin/bash
arg1=$1
# 0) HTW-SSL-Split
# 1) HTW-SSL-VPN-Full
# 2) HTW-SSL-VPN-Split
group=2
@BlkPingu
BlkPingu / mail filters
Last active July 18, 2019 21:53
Bash Filter
grep -r -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" . > ~/Desktop/emails.txt
awk '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}' emails.txt emailsfiltered.txt
@BlkPingu
BlkPingu / ResultSet.java
Last active January 8, 2019 12:06
jdbc result set iterator
public void Showsingle(){
boolean next = true;
try {
Class.forName( DRIVER );
c = DriverManager.getConnection( Connection, user, passwort );
System.out.println( "Opened database successfully" );
stmt = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);//Zum Durchiterieren TYPE_SCROLL_INSENSITIVE
ResultSet rs = stmt.executeQuery( "SELECT * FROM standort;" );
@BlkPingu
BlkPingu / Main.java
Last active October 17, 2018 17:50
Basic Java Command Line User Interface (CUI)
import userinterface.Userinterface;
public class Main {
public static void main(String[] args) {
Userinterface userinterface = new Userinterface();
userinterface.run();
}
}