Find duplicate usernames in /etc/passwd
# cat /etc/passwd | awk -F: ‘{print $1}’ | sort | uniq -c | grep -v 1 # cat /etc/shadow | awk -F: ‘{print $1}’ | sort | uniq -c | grep -v 1 # awk -F: ‘{ print $1, $5}’ /etc/passwd
A chronological documentation test project, nothing serious, really!
# cat /etc/passwd | awk -F: ‘{print $1}’ | sort | uniq -c | grep -v 1 # cat /etc/shadow | awk -F: ‘{print $1}’ | sort | uniq -c | grep -v 1 # awk -F: ‘{ print $1, $5}’ /etc/passwd
This is an example on how you an use stored triggers in mySQL /* test_workaround.sql */ USE test ; DROP TABLE IF EXISTS `addresses`; CREATE TABLE `addresses` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `created_on` DATETIME NOT NULL DEFAULT ‘0000-00-00 00:00:00’, `updated_on` DATETIME NOT NULL DEFAULT ‘0000-00-00 00:00:00′, `mac_address` CHAR(17) NOT NULL DEFAULT ’00:16:DD:xx:xx:xx’, /* […]
This command have to be performed in the vim editor: :%s/hardware ethernet 0:/hardware ethernet 00:/
Sometimes you want to have users, that have access to files on your server, but don’t want them to be able to log in and execute commands on your server.
If you have the Apache webserver running on port 80 that will provide a suitable test candidate. If not you can choose another port you know is in use.