Skip to content

Instantly share code, notes, and snippets.

@gehaxelt
gehaxelt / lockscreen.sh
Created January 13, 2018 22:41
Automatically lock all screens with xscreensaver-command --lock
#!/bin/sh
# Based on https://raw.githubusercontent.com/aminb/usb-lock/master/onusbunplug.sh
getXuser() {
user=`pinky| grep -m1 ":$displaynum" | awk '{print $1}'`
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY="$userhome/.Xauthority"
else
@gehaxelt
gehaxelt / Fancybox.rb
Created September 15, 2012 14:09
Fancybox.rb
# - baseURL statt "../" im href-Tag
# - Angabe eines Alt/Title-Tags für die Bilder
# -> Octopress-Aufruf {%fancybox IMGNAME TITLE ALT %}
module Jekyll
class Fancybox < Liquid::Tag
#@@baseURL = "http://gehaxelt.in"
def initialize(name, args, tokens)
super
@gehaxelt
gehaxelt / SQLInjectionActivity.java
Created June 2, 2012 21:11
SQLInjectionActivity-Class for an android application
package in.gehaxelt.sqlinjection;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class SQLInjectionActivity extends Activity implements OnClickListener {
@gehaxelt
gehaxelt / Databasehelper.java
Created June 2, 2012 20:41
Databasehelperclass for SQLite support in android
package in.gehaxelt.sqlinjection;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
@gehaxelt
gehaxelt / passwordgenerator_js.html
Created June 1, 2012 17:11
Simple passwordgenerator written in Javascript
<!--
Passwordgenerator written in Javascript by gehaxelt
www.gehaxelt.in
-->
<html>
<head>
</head>
<body>
<div id="passwordgenerator">
<input type="checkbox" id="Big" ><label for="Caps">ABC</label><br />
@gehaxelt
gehaxelt / ejabberd.cfg
Created May 25, 2012 09:44
Default configuration file of ejabberd
%%%
%%% ejabberd configuration file
%%%
%%%'
%%% The parameters used in this configuration file are explained in more detail
%%% in the ejabberd Installation and Operation Guide.
%%% Please consult the Guide in case of doubts, it is included with
%%% your copy of ejabberd, and is also available online at
%%% http://www.process-one.net/en/ejabberd/docs/
@gehaxelt
gehaxelt / ejabberd.conf
Created May 24, 2012 19:38
Ejabberd configuration file - example
{loglevel, 2}. %%!!Loglevel ändern auf 2
{hosts, ["your-domain.de"]}. %%!!Domain hier eintragen
{listen,
[
{5222, ejabberd_c2s, [ %%!!Port hier ändern, auf dem der Server erreichbar sein soll.
{certfile, "/home/benutzername/jabber/ejabberd/mycert.pem"}, starttls, %%!!Pfad zur mycert.pem
{access, c2s},