Have you ever setup a cool /etc/motd on your Ubuntu installation just to see it vanish after a reboot? We don’t need Scooby and the gang to solve this mystery since it’s obviously a start-up script.
Here some cli medicine to make things all better:
touch /etc/motd.static && rm -f /etc/motd; ln -s /etc/motd.static /etc/motd
By default /etc/motd is symlinked to /var/run/motd which is rebuilt by /etc/init.d/bootmisc.sh every time you reboot.
It is fairly common knowledge among IT professionals that the Windows command line is fairly weak. While PowerShell looks promising it will not be installed by default until Windows Server 08 R2.
It’s alright though since the CLI in Windows isn’t as shabby as it is obscure. Take for example findstr and find. While not as powerful as it’s nix big brother ‘grep’, findstr does a fairly good job and even support regexp. Here are a few handy examples of both commands in action:
finding possible ddos attack to port 80:
netstat -ano | sort /+33 | find ":80 " | more
grep -Rli findme *
findstr /sim findme *
The useful grep -v
netstat -ano | findstr -v "127.0.0.1"
finding a service name (I can never remember windows service names)
sc query | findstr /i "^service_name.*wua"
I’ve noticed some of the technicians I work with add the hyphen to the end of the ‘su’ command and some do not. I am one of those that do not do this. Why type an extra character? To my suprise I’ve actually been doing more typing by leaving off that little hypen. The hyphen sets you up in root’s enviroment instead of the previous users. No more having to manually prefix commands with ‘/sbin/’. Woo hoo. The things I get excited about.