This file contains hidden or 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/perl -w | |
open SHD, "<", "/etc/shadow" or die "cannot open /etc/shadow: $_"; | |
while(<SHD>) { | |
@fields = split /:/; | |
print("\ndn: uid=$fields[0],ou=People,dc=fachschaft,dc=informatik,dc=tu-darmstadt,dc=de\n"); | |
print("changetype: modify\n"); | |
print("replace: userPassword\n"); | |
print("userPassword: {crypt}$fields[1]\n"); | |
} |
This file contains hidden or 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 | |
#Copyright (C) 2015 Max Weller | |
#This program comes with ABSOLUTELY NO WARRANTY. This is free | |
#software, and you are welcome to redistribute it under certain | |
#conditions; see LICENSE for details of the BSD 2-Clause License | |
if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then | |
cat <<EOHELP | |
Usage: $0 MANIFEST PUBKEY... | |
This file contains hidden or 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
\documentclass | |
[foldmarks=true,foldmarks=BlmTP,firstfoot=true, | |
fromalign=no,fromrule=no,backaddress=plain,refline=narrow, | |
version=last]{scrlttr2} | |
\usepackage[utf8]{inputenc} | |
\usepackage[ngerman]{babel} | |
\usepackage{graphics} | |
\LoadLetterOption{../mwbrief} | |
This file contains hidden or 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
<?php | |
$f3 = require('lib/base.php'); | |
$f3->set('DEBUG',5); | |
$test=new Test(); | |
$dbpath = __DIR__ . '/_test.sqlite'; | |
echo "Using test db: $dbpath\n"; | |
$db=new DB\SQL('sqlite:'.$dbpath); |
This file contains hidden or 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
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET NAMES utf8mb4 */; | |
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | |
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | |
-- Exportiere Struktur von Tabelle adr_postleit | |
CREATE TABLE IF NOT EXISTS `adr_postleit` ( | |
`plz` varchar(5) NOT NULL, | |
`ort` varchar(50) DEFAULT NULL, | |
`kreis_nr` varchar(5) DEFAULT NULL, |
This file contains hidden or 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
-- -------------------------------------------------------- | |
-- Host: xx | |
-- Server Version: xx | |
-- Server Betriebssystem: xx | |
-- HeidiSQL Version: 9.3.0.4984 | |
-- -------------------------------------------------------- | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET NAMES utf8mb4 */; | |
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
This file contains hidden or 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
def drawbars(img, width, height): | |
x=0 | |
while x<width: | |
img.paste((255,0,0), (x,0,x+1,height)) | |
x+=2 | |
img.paste((255,0,0), (x,0,x+3,height)) | |
x+=6 | |
img.paste((0,255,0), (x,0,x+1,height)) | |
x+=2 |
This file contains hidden or 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/bash | |
if [[ $EUID != 0 ]] ; then | |
echo This must be run as root! | |
exit 1 | |
fi | |
for xhci in /sys/bus/pci/drivers/?hci_hcd ; do | |
if ! cd $xhci ; then |
This file contains hidden or 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 | |
CHOICES="Rock Paper Scissors Lizard Spock" | |
check_rule() { | |
user="$1"; computer="$2"; draw="yes" | |
while read rulestr ; do | |
rule="$rulestr" | |
winner="${rule%% *}"; rule="${rule#* }" | |
verb="${rule%% *}"; rule="${rule#* }" |
This file contains hidden or 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
openssl genrsa -out rootCA.key 2048 -nodes | |
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem | |
openssl pkcs12 -export -in rootCA.pem -out rootCA.pkcs12 -inkey rootCA.key -name "fooCA" | |
certhash=$(openssl x509 -in rootCA.pem -subject_hash_old -noout) | |
cat rootCA.pem > $certhash.0 | |
openssl x509 -inform PEM -text -in rootCA.pem -out /dev/null >> $certhash.0 |