Entries tagged as ‘Tutorial’

I use a laptop with Ubuntu 8.10 installed at work. While running the some high process, the CPU temperature get really high and its automatically shutdown the system. This thing happen every 2 or 3 days and its really annoying. The syslog showed the following error message:
ACPI: Critical trip point
Critical temperature reached (100 C), shutting down.
I know it is a safety feature, but really, I can’t afford to keep having the system shutdown while my system doing something important. My system fans are working but for whatever reason my CPU temp exceeds the critical threshold of 99C. On some systems you can see what your threshold is within the BIOS and even edit it but not on this one. So what’s a frustrated developer supposed to do? Well, it turns out you can tell you system to ignore the high temp threshold and to just keep on chugging along. NOTE: This isn’t the best advice I ever gave, if you do this then fry your CPU don’t come bitching to me.
sudo vi /etc/modprobe.d/options
Go to the last line of the file and add:
options thermal nocrt=1
Save the file.
Once you have this option set you need to reconfigure the kernel to pick up these changes, enter the following command:
sudo dpkg-reconfigure linux-image-$(uname -r)
This will update your kernel and then tell you to restart when it is done. Once you restart the system, type the following command the verfiy:
cat /proc/acpi/thermal_zone/*/*
It should display something similar like below.
<setting not supported>
<polling disabled>
state: ok
temperature: 52 C
critical (S5): 99 C <disabled>
Now your system won’t restart when the critical heat point is passed. Again, don’t blame me if you hurt your machine by doing this.
Categories: Linux / Unix · Tutorial · Ubuntu
Tagged: Linux, Tutorial, Ubuntu
If your memory or mistyping leaves you without the right password to get into an account on a Linux computer, there’s no need to reformat. You’ll just need to reboot into single user mode to reset it. Here’s how to do it on a typical Ubuntu machine with the GRUB bootloader:
- Reboot the machine.
- Press the ESC key while GRUB is loading to enter the menu.
- If there is a ‘recovery mode’ option, select it and press ‘b’ to boot into single user mode.
- Otherwise, the default boot configuration should be selected. Press ‘e’ to edit it.
- Highlight the line that begins with ‘kernel’. Press ‘e’ again to edit this line.
- At the end of the line, add an additional parameter: ’single’. Hit return to make the change and press ‘b’ to boot.
Change the admin password
The system should load into single user mode and you’ll be left at the command line automatically logged in as root. Type ‘passwd’ to change the root password or ‘passwd someuser’ to change the password for your “someuser” admin account.
Reboot
Once your done, give the three finger salute, or enter ‘reboot’ to restart into your machine’s normal configuration.
That’s all there is to it. Now just make sure to write your password down on a post-it and shove it somewhere safe like under your keyboard.
[ Source: Hackzine.com ]
Categories: Linux / Unix · Security · Tutorial
Tagged: Linux, Tutorial
Dual-booting with Ubuntu and Windows sometimes giving a problem with date and time in Ubuntu. This is a well-established problem when dual-booting, since Linux assumes the hardware clock represents UTC, whereas Windows assumes the hardware clock represents local time. Luckily Linux provides ways to change this to fix it.
If you go into your clock settings, I think you can select between setting the hardware as either UTC or local time. Try switching that, and then adjust the time and see if it “sticks.”
If not, you can do this via the commandline in Linux :-
- In Linux, set the date and time to what it currently is. For example if it’s 10:20am local time:
user@server:~$ sudo date -s 10:20
- Then update the hardware clock accordingly, and force this to be considered “localtime”:
user@server:~$ sudo /sbin/hwclock --systohc --localtime
- Check to make sure it looks right:
user@server:~$ sudo /sbin/hwclock --localtime
- Sync between hardware clock and system clock:
user@server:~$ sudo /sbin/hwclock --hctosys --localtime
Now Linux should consider the clock to be “localtime”, which should be identical to what Windows is doing. So after rebooting into Windows, the time should look right.
Hope that helps.
Categories: Linux / Unix · Tutorial
Tagged: Linux, Tips & Tricks, Tutorial, Ubuntu
It is possible to create a “reverse” SSH Tunnel. The reverse tunnel will allow you to create an SSH Tunnel from your work computer to your home computer, for example, and then login to your work machine from your home machine even if your work firewall does not permit ssh traffic initiated from your home machine!
For this to work, an SSH Server must be installed on your work and home computer, and ssh (TCP port 22) must be allowed outbound from your work computer to your home computer.
Syntax: ssh -R remote_port:localhost:22 your_home_computer
At home, you would then run ssh -p 2048 localhost to log into your work computer via ssh.
Here is a script that you can run through the cron facility on your work system to make sure the reverse SSH Tunnel to your home system is up and running. It is useful in case the system is rebooted.
#!/bin/sh
# $REMOTE_HOST is the name of the remote system
REMOTE_HOST=remote.system.ip
# $REMOTE_PORT is the remote port number that will be used to tunnel
# back to this system
REMOTE_PORT=5000
# $COMMAND is the command used to create the reverse ssh tunnel
COMMAND=”ssh -q -N -R $REMOTE_PORT:localhost:22 $REMOTE_HOST”
# Is the tunnel up? Perform two tests:
# 1. Check for relevant process ($COMMAND)
pgrep -f -x “$COMMAND” > /dev/null 2>&1 || $COMMAND
# 2. Test tunnel by looking at “netstat” output on $REMOTE_HOST
ssh $REMOTE_HOST netstat -an | egrep “tcp.*:$REMOTE_PORT.*LISTEN” \
> /dev/null 2>&1
if [ $? -ne 0 ] ; then
pkill -f -x “$COMMAND”
$COMMAND
fi
Categories: Linux / Unix · Security · Tutorial
Tagged: Linux, Security, SSH, Tunnel, Tutorial, Unix
Connecting two server running different type of SSH can be nightmare if you does not know how to convert the key. In this tutorial, I will try to explain on how to convert the public key from OpenSSH to SSH2 and SSH2 to OpenSSH. To convert the key, it must be done in OpenSSH server.
Convert OpenSSH key to SSH2 key
- Run the OpenSSH version of ssh-keygen on your OpenSSH public key to convert it into the format needed by SSH2 on the remote machine. This must be done on the system running OpenSSH.
#ssh-keygen -e -f ~/.ssh/id_dsa.pub > ~/.ssh/id_dsa_ssh2.pub
Convert SSH2 key to OpenSSH key
- Run the OpenSSH version of ssh-keygen on your ssh2 public key to convert it into the format needed by OpenSSH. This needs to be done on the system running OpenSSH.
#ssh-keygen -i -f ~/.ssh/id_dsa_1024_a.pub > ~/.ssh/id_dsa_1024_a_openssh.pub
(more…)
Categories: Linux / Unix · Security · Tutorial
Tagged: Howto, Linux, OpenSSH, Security, SSH, SSH2, Tutorial
Using the same tutorial for searchinfg files from MediaFire, we will search the files from Rapidshare.com or Rapidshare.de with the extra parameter on the search format.
Just visit Google.com and type “site: rapidshare.com” or “site:rapidshare.de” followed by:
- “inurl:pdf” for e-book in PDF format
- “inurl:avi|wmv|mpg|mpeg|mov|mpeg4″ for movie format.
- “inurl:mp3|wma|ogg” for audio format.
- “inurl:exe|msi” for Windows executable format.
- “inurl:zip|rar|7z” for Windows compression format.
Example: site:rapidshare.com inurl:zip|rar|7z winzip
Categories: Google · Tutorial
Tagged: Google, How To, Rapidshare, Tutorial
Restore GRUB quite simple in Ubuntu, instead going through all the “gain root access” and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
- Boot your computer up with Ubuntu CD
- Go through all the process until you reach “[!!!] Disk Partition”
- Select Manual Partition
- Mount your appropriate linux partions
/
/boot
swap
- DO NOT FORMAT THEM.
- Finish the manual partition
- Say “Yes” when it asks you to save the changes
- It will give you errors saying that “the system couldn’t install …..” after that
- Ignore them, keep select “continue” until you get back to the Ubuntu installation menu
- Jump to “Install Grub ….”
- Once it is finished, just restart your computer
Another way to restore GRUB, for advance users.
- Pop in the Live CD, boot from it until you reach the desktop.
- Open a terminal window or switch to a tty.
- Type “grub”
- Type “root (hd0,6)”, or whatever your hard disk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
- Type “setup (hd0)”, or whatever your hard disk number is.
- Quit grub by typing “quit”.
- Reboot.
Good luck!!!
Categories: Linux / Unix · Tutorial
Tagged: GRUB, Tutorial, Ubuntu
November 12, 2007 · 1 Comment
Ever wonder what software version numbers such as 1.1.1 mean? The first number in the series represents the ‘major’ release number. The second represents a minor release – one that usually includes some added features. The third typically represents a ‘patch release’, or one that fixes some bugs discovered after the product was released.
Categories: Software · Tutorial
Tagged: Tutorial, Version
October 17, 2007 · 1 Comment
Nick L.A. wrote some pretty cool hacks on how to modify wordpress themes and wordpress code to use it as a general CMS platform and not only as blogging platform. Tricks are easy to use for non developers.
[ Source: WordPress Theme Hacks ]
Categories: Software · Tutorial · Wordpress
Tagged: CMS, Hacks, Tutorial, Wordpress
A great little guide to setting up two accounts so that you don’t have to type in your password when sshing between them. btw, OS X uses OpenSSH. I don’t know what it is for other platforms.
Basic Idea
No-password authentication works because of public key crypto. Let’s say you have a local machine Ooga and a remote machine Booga. You want to be able to ssh from Ooga to Booga without having to enter your password. First you generate a public/private RSA key pair on Ooga. Then you send your public key to Booga, so that Booga knows that Ooga’s key belongs to a list of authorized keys. Then when you try to ssh fromOoga to Booga, RSA authentication is performed automagically.
Here are detailed steps on how to do this.
NOTE: The following examples and scenarios assume you are creating only a single key, e.g. one RSA key or one DSA key. If it turns out that you’ve created both keys on your (client) system, then you will need to send both of them to the SSH/SSH2 server; otherwise, you may still be asked to enter a passphrase. (more…)
Categories: Linux / Unix · Security · Tutorial
Tagged: How To, Linux, OpenSSH, Security, SSH, SSH2, Tutorial