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 | |
# | |
# 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"; |
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 | |
# | |
# 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. |
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 | |
# | |
# 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; |
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
" 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 |
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 | |
# | |
# 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 | |
# [email protected], hashes are sorted on users names | |
# before printout. |
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 | |
# | |
# 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/; |
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 | |
# | |
# Mailing systeminfo to $admin | |
use Mail::Sendmail; | |
# Set mailadresses. | |
$admin = 'root@localhost'; | |
$from = '[email protected]'; | |
# Commands which output will be sent. |
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 | |
# | |
# 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; |
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 | |
# | |
# Anton Lindstrom | |
# | |
# Program to print out files for users. | |
# Controlling directory recursive and sets | |
# files in array. | |
# | |
use warnings; | |
use POSIX qw/ceil/; |
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 | |
# | |
# Script to catch authentication failures in auth.log. | |
# Catching three different error types. | |
# | |
# Author Anton Lindstrom | |
# [email protected] | |
use warnings; | |
use strict; |
OlderNewer