This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
DROP FUNCTION IF EXISTS check_password; | |
CREATE FUNCTION check_password(U VARCHAR(255), P VARCHAR(255)) RETURNS BOOLEAN | |
BEGIN | |
DECLARE auth SMALLINT DEFAULT 0; | |
DECLARE return_value SMALLINT; | |
SELECT COUNT(*) INTO auth FROM users WHERE username = U and password = ENCRYPT(P, password) LIMIT 1; | |
IF auth > 0 THEN | |
SELECT SCRAM("HOSTNAME", U, P) INTO return_value; | |
END IF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import dbus | |
import sys | |
import gtk | |
from optparse import OptionParser | |
LD_PATH="org.freedesktop.login1" | |
LD_OBJ="/org/freedesktop/login1" | |
LD_IFACE="org.freedesktop.login1.Manager" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 58513c0528a991c0ba0be17adb0fb26407a66742 | |
Author: Lennart Weller <lhw@ring0.de> | |
Date: Thu May 21 13:27:54 2015 +0000 | |
userswitch | |
--- a/fcgiwrap.c | |
+++ b/fcgiwrap.c | |
@@ -61,6 +61,9 @@ | |
static const char **allowed_programs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cls | |
set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe" | |
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe" | |
echo Closing OneDrive process. | |
echo. | |
taskkill /f /im OneDrive.exe > NUL 2>&1 | |
ping 127.0.0.1 -n 5 > NUL 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dice coefficient for string similarity on natural text | |
Playground: http://play.golang.org/p/JFUjcpBb66 | |
*/ | |
package dicecoefficient | |
import "strings" | |
import "unicode" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
## This script extracts the game data and builds a debian archive which can be easily installed | |
## The following debian/ubuntu packages are required fakeroot, dpkg, imagemagick, innoextract | |
# | |
FILE=`zenity --file-selection --file-filter='*.exe'` | |
INFO=`zenity --forms --text "the scummvm short (e.g. sky) can be found here\n http://www.scummvm.org/compatibility/" --add-entry=scummvm-short` | |
GAME=`basename $FILE .exe | sed "s;setup_;;g"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
## Extracts inno setup and creates self extracting tar archive | |
## requires innoextract | |
# | |
FILE=`zenity --file-selection --file-filter='*.exe'` | |
GAME=`basename $FILE .exe | sed "s;setup_;;g" | sed "s;_;-;g"` | |
WORKSPACE=/tmp/$GAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, IOException { | |
final SecretKeySpec keySpec = new SecretKeySpec("4j#e*F9+Ms%|g1~5.3rH!we,".getBytes(), "AES"); | |
final Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); | |
cipher.init(Cipher.DECRYPT_MODE, keySpec); | |
FileUtils.writeByteArrayToFile(new File("msgstore.db"), cipher.doFinal(FileUtils.readFileToByteArray(new File("msgstore.db.crypt")))); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def similarity(other) | |
b = [self, other].map{|s| 0.upto(s.length-2).map{|i| s[i,2].downcase unless s[i,2].include? " "}.compact} | |
(2.0 * ((1.0/(b.first.size + b.last.size)) * b.first.inject(0){|r,p1| | |
b.last.each{|p2| b.last.delete(p2) and r = r+1 and break if p1 == p2} | |
r | |
})).round(2) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:jessie | |
MAINTAINER Lennart Weller <lhw@ring0.de> | |
ENV TS3_VERSION 3.0.19.1 | |
ENV SINUS_VERSION 0.9.8 | |
RUN apt-get update && \ | |
apt-get install -y xinit xvfb libxcursor1 ca-certificates bzip2 curl libglib2.0-0 python libav-tools && \ | |
rm -r /var/lib/apt/lists/* |
OlderNewer