Skip to content

Instantly share code, notes, and snippets.

View antonlindstrom's full-sized avatar
👓

Anton Lindström antonlindstrom

👓
View GitHub Profile
@antonlindstrom
antonlindstrom / default-marathon
Created January 31, 2014 16:34
Marathon upstart script & wrapper
#HOST=127.0.0.1
MASTER=`cat /etc/mesos/zk`
@antonlindstrom
antonlindstrom / useradd.pl
Created April 8, 2009 09:39
School assignment
#!/usr/bin/perl
#
# Program for adding one user.
#
# Need to have username as input, rest is suggested by program.
# Output is a user in the *nix system.
# Print program start.
print "Add new user\n";
@antonlindstrom
antonlindstrom / batchadd.pl
Created April 8, 2009 21:04
School assignment #2
#!/usr/bin/perl -w
#
# Batch adding users.
#
# Opens files users.csv and passwd, adding users from .csv file.
# The program processes these and is using a letter first to differ
# users between existing then year when user is created and three
# letters from name and two from lastname.
# Full name and ssn in comment.
@antonlindstrom
antonlindstrom / pchange.pl
Created April 19, 2009 18:41
School assignment #3
#!/usr/bin/perl -w
#
# Check if original password has changed.
#
# Gets user ssn from passwd comment field and hashing it with Crypt::PasswdMD5.
# Program checks if the hashed reversed ssn is the same as the current password.
# Prints message if a user has not changed his/hers password.
# Include Crypt::PasswdMD5 Module.
use Crypt::PasswdMD5;
" Anton Lindstrom's .vimrc
" https://gist.github.com/99008
" Getting rid of vi bugs and turns syntax highlighting on
set nocompatible
syntax on
" History
set history=1000
@antonlindstrom
antonlindstrom / users2html.pl
Created April 23, 2009 14:32
School assignment #4
#!/usr/bin/perl -w
#
# Print out users in system to a html file.
#
# Opens files passwd and group, checks group for users in staff
# and assigns others in another array. Users names are assigned
# to a hash and then printed out as names in html list. Mail is
# username@universitetet.se, hashes are sorted on users names
# before printout.
@antonlindstrom
antonlindstrom / networkCheck.pl
Created April 30, 2009 11:59
School assignment #5
#!/usr/bin/perl
#
# Pinging a server and checking if Network services are up or down.
use warnings;
use IO::Socket::INET;
# Network services to check (dns will not resolv).
@services = qw/http https ssh telnet mail dns mysql/;
@antonlindstrom
antonlindstrom / MailProcesses.pl
Created May 5, 2009 15:11
school assignment #6
#!/usr/bin/perl
#
# Mailing systeminfo to $admin
use Mail::Sendmail;
# Set mailadresses.
$admin = 'root@localhost';
$from = 'sys@antonlindstrom.com';
# Commands which output will be sent.
@antonlindstrom
antonlindstrom / ProcessManagement.pl
Created May 5, 2009 15:20
School assignment #7
#!/usr/bin/perl
#
# Program for Process Management
# Require the neccesary modules.
use Proc::ProcessTable;
use POSIX qw/strftime floor ceil/;
# Initiate class Proc::ProcessTable.
$process = new Proc::ProcessTable;
#!/usr/bin/perl
#
# Anton Lindstrom
#
# Program to print out files for users.
# Controlling directory recursive and sets
# files in array.
#
use warnings;
use POSIX qw/ceil/;