Skip to content

Instantly share code, notes, and snippets.

View binzram's full-sized avatar
🎯
Focusing

Nomar Znip binzram

🎯
Focusing
  • Bern to MVD
View GitHub Profile
@binzram
binzram / data.json
Last active February 14, 2019 15:03
OPA Spikes, Permission example
# curl -X PUT http://localhost:8181/v1/data/permission -H 'Content-Type: application/json' -d '# Data #'
{
"write": [
{ "ressource": [1, 2], "context": null },
{ "ressource": [1, 3], "context": ["foo"] }
]
}
@binzram
binzram / AndroidManifest.xml
Created May 17, 2018 07:01
Landscape Android
<?xml version="1.0" encoding="utf-8"?>
<manifest>
...
<application>
<activity
android:name=".MainActivity"
android:screenOrientation="landscape">
...
</activity>
</application>
@binzram
binzram / Google2FA-Auth-example.md
Last active March 20, 2018 10:23
PHP Google Auth 2FA (student example, bbc)

Installing

composer require pragmarx/google2fa
composer require bacon/bacon-qr-code
#! /bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall-Script
# Description: Firewall-Script with IPTABLES
### END INIT INFO
package ch.bbc.wikicompare.algorythms;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class DiceCoefficent {
public double diceCoefficient(String s1, String s2)
{
Set<String> nx = new HashSet<String>();
@binzram
binzram / overtone_demo.md
Last active April 21, 2017 00:02
Overtone demo presentation FHTB
PATH=$PATH:/home/binzram/dev/overtone
emacs

M-x cider-jack-in

(ns ch.tsbe.binz(:use 
			[overtone.live]
			[overtone.inst.sampled-piano]
			[overtone.inst.drum :only [quick-kick haziti-clap soft-hat open-hat]]))
@binzram
binzram / Reflection.php
Created April 20, 2017 23:56
creates an reflection thumbnail (2013-11-25) similar to 1st gen Ipod product photos
<?php
namespace Reflection\ProcImg;
class Reflection{
private $size;
private $width;
private $height;
private $hoehe;
private $breite;
private $pathimg;
@binzram
binzram / find_mm_yyyy.sh
Created April 20, 2017 23:47
Find files in month range (2013-11-24)
#!/bin/sh
if [ "$#" -lt 2 ]; then
echo "Usage: `basename $0` MM YYYY [other find parameters]" >&2
exit 1
fi
set -e #exit early on error
month=$1
@binzram
binzram / win_ad_join.sh
Created April 20, 2017 23:43
Win AD auto-join (2015-04-30)
#!/bin/bash
#ENTER NAME SERVER IP-ADDRESS:
nsip=192.168.1.x
#ENTER DOMAIN CONTROLLER IP-ADDRESS:
dcip=192.168.1.x
#ENTER HOSTNAME OF FILE SERVER THAT HOSTS SHARES:
fsname=xxx
#ENTER DOMAIN CONTROLLER HOSTNAME (NOT FQDN! [MUST BE LOWERCASE]):
dc=xxx
@binzram
binzram / zombie_catcher.sh
Created April 20, 2017 23:35
Zombie process catcher
#!/bin/bash
ps aux | awk '{if ($8 = "Z") print $1,$2,$8,$11;}' | tee /home/$USER/zombie.tmp
ZCOUNT=$(wc -l /home/$USER/zombie.tmp | awk '{print $1}')
ZCOUNT=$(expr $ZCOUNT - 1)
echo "Total $ZCOUNT zombie processes found."
rm -f /home/$USER/zombie.tmp