Category: Unix

Mac Hack, Adding new root admin, without a CD !

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email

Alright, so i am fixing this Macbook, have no root access, and fortunately I do not need to access old profile files, which is actually the only down side to this method. I have my unix background but never really had a lot of practice on Mac books, so here is my first.

 

The official Apple method, requires a CD and can be viewed here

You need to enter terminal and create a new admin account:

1. Reboot
2. Hold apple key + s key down after you hear the chime. (command + s on newer Macs)
3. When you get text prompt enter in these terminal commands to create a brand new admin account (hitting return after each line):

mount -uw /
rm /var/db/.AppleSetupDone
shutdown -h now

4. After rebooting you should have a brand new admin account. When you login as the new admin you can simply delete the old one and your good to go again!

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email
 

download Premium links using unix WGET (Rapidshare Megashare Etc)

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email

AH !

Here is one nasty trick i’ve had trouble getting to find out, many people do have rapidshare or other account, and a unix server access or only SSH access …

Normally with Lynx its annoying, or even with multiple files downloads thats more annoying to handle, especially if you aint in the luv of waiting each download to finish or queue files..

Here is how you would do it easy  in 3 steps…

First :

Save Login Cookies ( Ill use rapidshare for this example )

wget –save-cookies ~/.cookies/rapidshare –post-data “login=USERNAME&password=PASSWORD” -O – https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null

Megaupload example … :

wget –save-cookies ~/.cookies/megaupload –post-data “login=1&redir=1&username=USERNAME&password=PASSWORD” -O – http://megaupload.com/?c=login > /dev/null

( The first highlighted can be changed to any path , remember it , ull use it ! )

Second:

Create a file containing all your rapidshare links …

Ill call it ::   down

Third Execute :

wget  -c –load-cookies ~/.cookies/rapidshare –input-file=-down -output-file=log -b

As you see, loading cookies, defining input file, log file ( you might cancel that after you know ur doing things right) and finally, the -b for background execution, that is unless u want to see verbose instead of output-file !

Blabbing about chmod , path (using ~ in my example) or ./ or whatever path is simply unneeded, if you know what is wget and understand whats written up, am sure you dont need the rest of silly advices.!

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email
 

Cpanel Exim Monitor outgoing and incoming mail

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email

It always takes sometime to research and find about how to put commands, but again u use it, and once again you forget how you did it the first time.

This is why i blog, mostly to keep some notes for myself and share as well !

Here is a quick solution to Cpanel users to monitor domain to an email.

(PS even if you are not on cpanel, just add an exim filter as below noted )

Open

/etc/cpanel_exim_system_filter

find

[code]

if not first_delivery

then

finish

endif

[/code]

add

[code]

if first_delivery

and ("$h_to:, $h_cc:" contains "domain.com")

or ("$h_from:" contains "domain.com")

then

unseen deliver "monitor@domain.com"

endif

[/code]

Replace as you see fit, and restart Exim !

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email
 

iTunes iPhone backup password removal

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email

Ok that was an issue i struggled with…

Basically as everyone would do , i googled..

Good luck in that, Apple advice you to format restore your iphone and setup a new phone ..

Goodbye to your old back and goodluck with that one…

Here is an easy fix… download iphone-explorer or iphone-browser (google those) free and fast.

Go to /Private/Var/KeyChains/keychain-2.db   << Delete this one only….

Ofcourse when i found about this, first i dragged a copy to my desktop just incase anything goes wrong.

Reboot…

Now go to uncheck that Iphone encrypt backup and any password you set will be yours .. Or ofcourse use a change password on that one.

Good luck on this neat trick.

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email
 

Unix CP command overwrite prompt

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email

For regular unix users, those shouldnt be a problem, but for novice users and sometimes forgetting ones, some issues can be confusing.

when using cp command as in
cp file.ext /path/to/new/folder
or
cp -r folder/* /path/to/new/folder               r for recursive copying
and sometimes
cp -fr folder/* /path/to/new/folder              r for recursive and f to force overwrite wihout prompts
sometimes it still prompts you, and if you are copying lots of files, this is a huge pain !
Here is a little neat trick
‘cp’ -r folder/* /path/to/new/folder
notice the ‘ surrounding the cp, this will force your os to override prompts and just apply the ccommand ! No more overwrite prompts …       Enjoy,

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare on MyspaceShare via email