My Writings. My Thoughts.
Rename Multiple Files In Debian or *nix
1:04 pm on November 10th, 2011 | No Comments » | Linux, SysAdmin, Tech
Obviously the n00b trick of trying to do
mv oldName* newName*
does not work.
Interestingly I just found that Debian has a “rename” command that supports perl regular expressions. So this would work in case you were wondering how:
rename 's/^oldName/newName/' oldName*
Check your man pages before you attempt this on a different *nix system. Different rename binaries might have different functionality.
vi – Used To Hate It
5:09 pm on July 26th, 2011 | No Comments » | General
Over the past few months editing configuration files and writing scripts, not programming, I’ve come to realize how awesome vi is and the plethora of operations you can perform on the text once you open it up in “vi”. Forget about nano/pico. Some common tasks you can do with vi…
Find and Replace: “g” indicates global or else vi only replaces once per instance per line.
:%s/find/replacewith/g
Find and Replace a “\”(windows) with a “/”(*nix):
:%s/\\/\//g
Line Numbers:
:set number
Go To Line Number:
:lineNumber
Remove Line Numbers:
:set no number
Search For Text(Case Sensitive):
/text
How To: Test mod_rewrite
3:07 pm on March 26th, 2011 | No Comments » | SysAdmin, Tech
This is more of a self-note to myself. This simple test will confirm if that mod_rewrite apache module you just enabled is actually working. Once you have enabled the mod_rewrite module using “a2enmod mod_rewrite”, create a .htaccess file in the document root with the following content:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.google.com/$1 [R=301,L]
Restart apache and go to that site of yours. You should be redirected to Google.com automagically. If not check your file permissions.
Mac OS X: How to connect to Windows File Sharing (SMB)
12:39 am on March 17th, 2011 | No Comments » | Linux, SysAdmin
I wanted to connect to my home server using my mac today. I said to myself RTFM and went through the Apple KB article mentioned here. Well that did NOT help at all. I kept getting “Invalid User” error. So then I said to myself “I will google it before asking dumb questions” and this is what found. You can use the same method to connect to any shared folders on a windows computer.
Open a “Finder” windows and press “Command-K”(or use Go > Connect to Server from the menu bar). Enter the url of your samba share as shown below. Depending on the settings of your samba server, if you don’t know the exact share name, you can omit the “/sharename” part from the url. The would open up a window with a list of all shares that you have access to.
DO NOT enter your credentials as shown below. This was why I was getting access errors. Make sure you delete any credentials stored in “Keychain Access” for this particular server if you saved some credentials that do not work.
Enter your credentials with the server name or ip followed by a forward slash and then username. This has been tested on 10.6 and should work for all other versions that support samba.
Remember to delete credentials saved to “Keychain Access” for this particular server if you need to connect to the same server but as a different user. This might come in hand when different folders are accessible only through user credentials.
HP Assumes You’re Stupid
6:29 pm on March 13th, 2011 | No Comments » | General, Tech
The other day I had to enable virtualization extensions on a HP laptop. There is absolutely no direct way to get to the BIOS. I had to go look up some documentation to finally find out that you have press F2 to get to boot options and then press F10 to get into BIOS, re-iterating my hate for all products HP.
Once you get in, you’re greeted by things like “specialized software applications” and “HP recommends that this feature remain disabled…”. I get it that laptops likes these are meant for normal users, but it should not mean that normal users are tech-illiterate and don’t know anything about virtualization.
P.S.: Awesome(sarcastic) BIOS utility name by the way – InsydeH20.




