Useful if you have several admins on a server, so you can figure out who did what when. Edit /etc/bashrc and add: export HISTTIMEFORMAT=”%h/%d – %H:%M:%S “
Archive for December, 2009
1 2 3 4 5 /path/to/command arg1 arg2 Where: * 1: Minute (0-59) * 2: Hours (0-23) * 3: Day (0-31) * 4: Month (0-12 [12 == December]) * 5: Day of the week(0-7 [7 or 0 == sunday]) * /path/to/command – Script or command name to schedule crontab -e = edit crontab -l = […]
Not sure why I always forget this, but to chown or chmod a symbolic link rather than its target use the -h (no-dereference) flag: chown -h new_user symbolic_link_name
Out of the box, Fedora seems to send every system event to the PC speaker, which is annoying! To disable: /sbin/rmmod -v pcspkr To make this a persistent change edit /etc/modprobe.d/blacklist.conf adding: blacklist pcspkr or edit: /etc/rc.local (loads on boot) adding: /sbin/rmmod -v pcspkr
Lots and lots of things are deprecated! Probably a good idea to change the error reporting to something like: error_reporting = E_ALL & ~E_NOTICE ~ E_DEPRECATED magic_quotes_gpc,register_globals,safe mode seem to be deprecated Short PHP tags are disabled by default: short_open_tag = On more to come I’m sure…….
/etc/init.d/mysql.server stop /usr/local/mysql/bin/safe_mysqld –user=mysql –skip-grant-tables –skip-networking & /usr/local/mysql/bin/mysql mysql> UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root'; mysql> FLUSH PRIVILEGES; mysql> exit /etc/init.d/mysql.server restart Probably a good idea to clear the MySQL history afterwards or pull in the update from a txt file and delete!
Appcmd list sites Appcmd list site “sitename” /config Appcmd start/stop sites “Default Web Site” (or whatever site you want to start) Appcmd add sites /name:”Site 5” /id:12 /bindings:http://mysite5.com:80 /physicalPath:C:\inetpub\site5 Backup IIS config: appcmd add backup appcmd list backup appcmd restore backup It has much much more functionality – appcmd /h
When you map a network drive in Windows, with a non-domain user for example, Windows will save the username but not the password. To persistently store the password, use the following from cmd: net use x: \\server’s.DNS.name\share /savecred /persistent:yes
A bit crude but it works. Make a schedule task for this batch file: del testsql1.asp C:\wget\wget.exe –timeout=30 –tries=1 http://www.website.com/testsql1.asp find /C “SQLServer Test Code 1″ testscript.asp IF ERRORLEVEL 1 IISRESET /RESTART /TIMEOUT:120 /REBOOTONERROR