Skip to content

Instantly share code, notes, and snippets.

@pweinzettel
pweinzettel / install_sqldeveloper.sh
Last active January 17, 2023 14:35
Install Oracle SQL developer
# Download Oracle SQL developer "Other Platforms" from https://www.oracle.com/tools/downloads/sqldev-downloads.html
# Check java version and required version on download page
java --version
# If java is missing, install with
apt-get install default-jre
@pweinzettel
pweinzettel / gist:2d52cbaf1f7b7764a263e3ac535da179
Created January 17, 2023 14:03
Install Oracle ASH Viewer
# Download ASH Viewer from https://github.com/akardapolov/ASH-Viewer/releases/
# Check java version and required version on download page
java --version
# If java is missing, install with
apt-get install default-jre
@pweinzettel
pweinzettel / bytes2human.fnc
Created November 19, 2021 16:50
bytes2human
create or replace function bytes2human(val in varchar2) return varchar2 is
res varchar2(50);
num number;
unit varchar2(1);
pow integer;
type array_t is varray(6) of varchar2(1);
pow2unit array_t := array_t('', 'K', 'M', 'G', 'T', 'P');
begin
num := regexp_replace(val, '[^0-9,.]', '');
@pweinzettel
pweinzettel / post.js
Created June 26, 2021 01:14
redirect and post json data using forms
function post(url, data) {
var form = $(document.createElement('form'));
$(form).attr("action", url);
$(form).attr("method", "POST");
$(form).prop("hidden", true);
for (const key in data) {
var input = $("<input>")
.attr("type", "text")
.attr("name", key)
@pweinzettel
pweinzettel / date_sync.sh
Created January 26, 2021 17:35
bash sync date from google without NTP
date -us "$(curl -Is google.com | grep '^Date:' | cut -d' ' -f3-)"
@pweinzettel
pweinzettel / namecheap.sh
Created March 6, 2021 00:28
namecheap dynamic dns update
#!/bin/bash
### CONFIG INI
HOST='subdom'
DOMAIN='example.com'
PASSWD='<SECRET>'
URL='https://dynamicdns.park-your-domain.com/update'
### CONFIG END
IP=$(curl -s ifconfig.me)
@pweinzettel
pweinzettel / droidcam.sh
Created August 28, 2020 04:05
Execute DroidCam on the phone and client on pc from bash
#!/bin/bash
readonly LOG_FILE=/var/log/droidcam.log
exec 1>$LOG_FILE
exec 2>&1
port=4747
date
env
/usr/bin/id
@pweinzettel
pweinzettel / vt8.sh
Created August 28, 2020 00:24
Run Virtual Box (or any other gui software) on separate virtual terminal
#!/bin/bash
# To get the vmid, use:
# VBoxManage list vms
VM="{3b019d6d-16d1-4a8b-909d-8c79e53abd2d}";
XN=4;
XS=/tmp/.X11-unix;
# Create a new X server on vt8
@pweinzettel
pweinzettel / touch-monitor.sh
Created September 3, 2020 02:04
Map an input device to an output screen
#!/bin/bash
declare $(xinput | grep -i touchscreen | awk {'print$5'})
monitor=$(xrandr | grep primary | awk {'print$1'})
xinput map-to-output ${id} ${monitor}
@pweinzettel
pweinzettel / wav-mp3
Created August 28, 2020 03:56 — forked from championofblocks/wav-mp3
Command line bash to convert all wav to mp3
for i in *.wav; do test -f "${i%.wav}.mp3" || lame -b 320 -h "${i}" "${i%.wav}.mp3"; done