Skip to content

Instantly share code, notes, and snippets.

View mschmitt's full-sized avatar
🥾
Busier than a one-legged man in an ass-kicking contest.

Martin Schmitt mschmitt

🥾
Busier than a one-legged man in an ass-kicking contest.
View GitHub Profile
@mschmitt
mschmitt / gist:3901269
Created October 16, 2012 19:03
Friendica Helpers
The helpers I used for translating Friendica:
Makefile in views/eo-test:
all:
/opt/apache-php/bin/php ../../util/po2php.php ../eo-test/messages.po
copy:
cp *.tpl ../eo/
cp *.po ../eo/
cp *.php ../eo/
@mschmitt
mschmitt / m4a.nonymize
Created November 29, 2012 20:45
m4a.nonymize - Strip tags from purchased and/or matched M4A files.
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Audio::M4P::QuickTime;
# m4a.nonymize
#
# Strip tags from purchased and/or matched M4A files.
#
# Use: m4a.nonymize file [file] [file] ...
@mschmitt
mschmitt / Keypress.ino
Created February 1, 2013 07:09
Arduino Leonardo: Send key when a button is pressed.
// Arduino Leonardo: Send key when a button is pressed.
void setup() {
pinMode(12, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
//if the button is pressed
if(digitalRead(12)==LOW){
== unnamed, Poweredge R720, Dual Intel Xeon E5-2667, 2.90GHz, 2x Dell Express Flash 175GB P320h, ext4 auf Stripe via LVM ==
Version 1.03e ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
unnamed 63G 1235071 99 565053 68 1264927 73 +++++ +++
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
128 113408 97 +++++ +++ 116876 85 106704 96 +++++ +++ 99495 79
@mschmitt
mschmitt / imaplevel.pl
Last active December 12, 2015 10:39
Delete all but the most recent 10000 messages from IMAP folders
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Mail::IMAPClient;
use Getopt::Std;
my $imap_host = 'localhost';
my $imap_user = 'martin';
my $imap_pass = 'denkste';
my $imaplevel = 10000;
@mschmitt
mschmitt / utmp-test.pl
Created February 20, 2013 20:54
Playing with utmp(5).
#!/usr/bin/perl -w
use strict;
use diagnostics;
use POSIX;
use User::Utmp qw(:constants);
my $idle_threshold = 1800; # seconds
while (my $utent = User::Utmp::getutent()){
# Skip irrelevant utmp entries that are not interactive sessions
@mschmitt
mschmitt / Perl One-Liner
Created May 14, 2013 08:08
Disable password aging for all users without password hash and UID>=500
# Disable password aging for all users without password hash and UID>=500
perl -MUser::pwent -e 'while($e=getpwent()){$e->uid<500&&next;
$e->passwd!~/^!!/&&next;$cmd="chage -E -1 -I -1 -M -1 ".$e->name;
print"$cmd\n";system($cmd);}'
@mschmitt
mschmitt / RPM One-Liner
Created May 14, 2013 08:27
Print a proper list of installed RPMs
rpm -q --qf='%{NAME};%{VERSION}-%{RELEASE};%{ARCH};%{VENDOR};%{SUMMARY}\n' -a | column -t -s ';'
@mschmitt
mschmitt / matchpwhash.pl
Last active October 16, 2017 08:46
Check whether a given password matches a given salted hash from /etc/shadow.
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Crypt::Passwd::XS;
print "Paste hash here: ";
my $hash = <>;
print "Enter password (will not echo): ";
system('stty', '-echo');
my $pass = <>;

Enkonduko por tradukontoj

Jen la teksto je kiu estas bazitaj la tradukaĵoj en naciaj lingvoj. Se ankoraŭ ne ekzistas tradukaĵo en via lingvo (trovebla per la menuo supre-maldekstre ĉe eomo.info), plia tradukaĵo estas bezonata. Bonvolu atenti ke ĉi-tiu teksto havas alian vidpunkton ol la esperantlingva teksto sur la retejo. Bonvolu ne traduki la esperantlingvan tekston kiu troviĝas sur la retejo, sed tiun-ĉi. (La franca kaj rusa tradukaĵoj kiuj nuntempe enretas bazas je la malĝusta teksto kaj bezonas reviziojn.)

Mi petas ke vi lasu la tradukaĵon tie ĉi kiel komento ău sendu ĝin al nia retpoŝtadreso: kontakto (ĉe) eomo (punkto) info.

Se vi estas sperta programisto aŭ retfasonisto kaj scipovas uzi la programon git kaj la retejon GitHub, vi povas ankaŭ rekte aldoni vian tradukaĵon al la dosiero index.html en forko de la originala projekto eomo-retejo kaj sendi tirpeton (vulgare: pull request) al mi.

(Pro informo, jen la estinta kunlabor