Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

How to Change Your Local IP Address

Your Public IP address is what identifies your computer when you to connect to the internet. It is assigned by your ISP and depending on the type of service you have subscribed to, your public IP may remain the same (Static IP) or is periodically updated (Dynamic IP). Basically if you want to change your public IP then the only way is to get in touch with your ISP or use a proxy service such as Tuxler or Hotspot Shield to hide/spoof your IP address. 

Each computer also have the local IP address. The local IP which is also referred as Private IP address is used to identify computers on the local network (behind the same router) and it is managed by the operating system. If required, the local IP of a machine can be changed via the router settings (refer to the manual provided with the router or check on the manufacturer's website) or you can change it via the Windows Control Panel.


Refresh your IP

There exists a simple command in Windows to refresh your current IP, which can be useful to fix IP address conflicts when two computers present on the same DHCP network share the same IP. But it should be noted that this procedure generates a "random IP" (within the allowed range). 

Click on Start > Run > type cmd and press Enter to open the Command Prompt. Next, type ipconfig
 to view the current address. Type  ipconfig / release , followed by ipconfig / renew


Change your local IP

Open the Control Panel > Network and Sharing Center > Change Adapter Settings Network Connections. A list of known connection will be displayed (Ethernet or Wi-Fi). Right-click on the desired connection and select Properties from the contextual menu. Under This connection uses the following items select Internet Protocol Version 4 (TCP / IPv4) and then click onProperties


Select the Use the following IP address option instead of Obtain an IP automatically (default) and register the IP address (within the pool of acceptable IP addresses and which is not already in use by another computer), Subnet MaskDefault Gateway and DNS Server addresses:


Click on Apply > Ok.

Save Web Pages as PDFs Without Installing Extensions

While there are plenty of PDF writing software and online conversion services around that can help you save web pages as PDF files, the fact is that you don’t need any of them as long as you have Google Chrome on your computer.

Open any web page inside Google Chrome, press Ctrl+P (or Cmd+P if you are on a Mac) to open the Print dialog and change the destination printer to “Save as PDF.” Hit the Print button and the current web page will instantly download as a PDF document. Simple!


You neither have to install any software on your computer nor any extensions in your browser because Google Chrome itself acts as the PDF writer.
This is especially useful for downloading PDF copies of web pages that involve transactions or session data – like the checkout page on a shopping website – because you often cannot pass such pages to any online PDF conversion service.
One more thing. You can also use Chrome’s PDF engine to convert your local image files, text files and any local HTML web pages to PDFs – if you an open a file in Chrome, it can convert the file to PDF.

Parallels Workstation for Windows & Linux – Free Download

Parallels Workstation is a commercial desktop virtualization program that lets you run multiple Operating systems on the single physical computer and you can easily switch between them without rebooting.




For instance, you could be running Windows Vista and but some of your programs (like your old Tally accounting software) require Windows 2000 or XP. In that case you can download Parallels Workstation, create a virtual machine for Windows XP and run it over Windows Vista just like any another software program. You can also use Parallels Workstation to run Linux on a Windows machine or vice versa.
If you are planning to rebuild a computer, it is recommended that you use a virtualization program like Parallels Workstation for all experimentation work – i.e., any software that you plan to use on a temporary or trial basis should be installed on the virtual machine and not on the main computer.
Parallels Workstation sells for $50 but you can request a licensed activation key for free using this Lunarpages offer. Key in your email address and they’ll immediately send you the download links for the trial version and serial number to convert the trial into a full retail version.
Virtual machines are very helpful for web designers as well as it lets you test websites on different browsers – you can have a virtual machine with IE 8 and another one with IE 6 while your main desktop is running the latest IE 7.
In case the above offer expires by the time you read this, you can always download the free Virtual PC (Microsoft) or Sun’s VirtualBox which is available for Mac as well. 

Use an Old Linux Computer to Put your Baby to Sleep

If you are not a geek, let me explain the logic of this very simple program. 






The program will first auto-eject the CD-ROM drive of your computer and then it will close that open tray. This open-close loop will run forever unless you terminate the program manually.
while [1 = 1]
do
#eject cdrom
eject

#pull cdrom tray back in
eject -t
done
Now the interesting part – using just these four lines of code, a geek turned his old Linux* computer into a baby rocker.

He attached a string between the tray of the CD-ROM drive and the baby seat and as the tray would open and close repeatedly, the smooth movements were enough to put his baby to sleep. Awesome.

[*] you are not on on Linux, you can build a similar Baby rocker program for Windows using Autohotkey software.

Essential Linux Commands for WordPress Users

Essential Linux Commands for WordPress Users

If you have limited Unix / Linux experience but are starting to use the shell to manage your WordPress installation, here are some handy command line tricks that will help you do common things a lot faster. Also, the commands listed here aren’t specific to any shell so you should be able to use them in any Linux environment.


Handy Command Line Tricks for Linux

1. Linux comes in several flavors. The following commands will help you determine which Linux distro is installed on your host, what’s the version of your Linux kernel, the CPU model, processor speed, etc.
$ cat /etc/issue
$ cat /proc/version
$ cat /proc/cpuinfo
2. Find the total amount of RAM available on your Linux box and how much is free.
$ free -mto
3. The command cd.. takes you up one directory level but cd – will move you to the previous working directory. Or use the command pwd to print the full path of the current directory that you can copy-paste later into the shell.
$ cd  – 
$ pwd
4. The command history will show a list of all the recently executed commands and each will have an associated number. Use ! to execute that command again. Or, if the history is too long, use grep to search a particular command.
$ !
$ history | grep
5. You can remove any particular command from the shell history by number.
$ history  – d 
6. If you made an error while typing a command name, just enter the correct command name and then use !* to reuse all the previous arguments.
$  !*
7. Re-run a command but after replacing the text abc in the command with xyz.
$ ^abc^xyz
8. This will list the size of all sub-folders of a directory in KB, MB or GB.
$ du  – sh */
9. A better version of the ls command that displays file sizes in KB and MB.
$ ls  – gho
10. You can use man  to learn more about the syntax of a command but what if you don’t remember the name of the command itself? Use apropos then.
$ apropos 
11. Compare the content of two text files to see what has changed.
$ diff wp-config.php wp-config.php.old
12. Find lines that are common in any two text files.
$ grep  – Fx  – f file-A.html file-B.html
13. Compare the content of two directories recursively.
$ diff  – urp /old-wp-directory /new-wp-directory
14. Find all files under the current directory that are larger than 10 MB in size.
$ find . -size +10M -exec du -h {} \;
15. Find all files on the system that have been modified in the last 2 days.
$ find .  – type f  – mtime -2
16. Find all files on the system that were modified less than 10 minutes ago
$ find .  – type f  – mmin -10
17. Find all PHP files that contain a particular word or phrase.
$ find . -name "*.php" -exec grep -i -H "matt mullenweg" {} \;
18. When copying or moving files, Linux won’t show a warning if you are overwriting an existing file. Therefore always use the – i switch to prevent overwrites.
$ cp  – i abc.txt xyz.txt
19. Backup the content of the current folder into a tarball file using gzip compression.
$ tar zcfv backup.tar.gz /wp-directory/
20. Find processes with the highest CPU usage. Then use kill – 9 pid to kill a process.
$ ps aux | sort -nrk 3 | head
21. Execute the following command in your Apache logs directory to determine hits coming from individual IP addresses.
$ cat access.log | awk '{print $1}' | sort | uniq -c | sort  – n | tail
22. Monitor hits from Google bots to your website in real-time.
$ tail  – f access.log | grep Googlebot
23. To find all files and web pages on your site that return a 404 error, run the following command in the Apache logs directory.
$ awk '$9 == 404 {print $7}' access.log | uniq -c | sort -rn | head
24. Find the 100 most popular pages of your site using Apache server logs again.
$ cat access.log | awk '{print $7}' |sort |uniq -c |sort -n |tail -n 100
25. Quickly find and replace a string in or more files.
$ find . -type f -name "*.php" -exec sed -i 's/wordpress/WordPress/' {} \;

How to Install Linux on your Windows Computer

Are you a Windows user who is curious to try Linux (Ubuntu in particular) because you have heard so many good things about the OS from your geek friends?  


There are two ways to use Linux on a Windows computer. You can either install the full Linux OS alongside Windows, or if you are just starting with Linux for the first time, the other easy option is that you run Linux virtually with making any change to your existing Windows setup.
The former option will offer the best performance because all your system resources will be available to Linux but the latter option is absolutely risk-free and therefore recommended for novice users. You’ll be able to test drive Linux but without changing a single file on your Windows computer.

Running Linux with Windows – Your Options

Let’s look at some of the easiest ways to use Linux on a Windows computer. Linux is available in multiple flavors (your friends may call them Linux distros) but here, let’s focus on the desktop edition of Ubuntu, perhaps the most popular and actively developed Linux distribution.

A: Test-Drive Linux Online as a Web App

Perhaps the easiest way to try Linux on your Windows Desktop is inside your web browser. Go to edubuntu.org, fill that simple form and within a minute, you’ll have the full version of Ubuntu Linux running on your desktop inside a Java applet.
There’s absolutely no need to download or install anything on your computer and a single session can last up to two hours. You get access to all the features that are available in the standard desktop edition of Ubuntu Linux including the ability to download and install new packages from the Linux repository.

B: Run Linux from a USB Stick or a CD

The most popular option to test-drive Linux on Windows is a LiveCD. Though it says “CD,” you can also use a USB Flash Drive as a LiveCD (without having to burn a CD).
To get started, download the latest version of Ubuntu to your desktop. This is an ISO file (also known as a CD image) that is around 650 MB in size. If you don’t have a great Internet connection, you can always borrow the Ubuntu CD from a friend (yes, its perfectly legal) or order a readymade live CD from OSDisc.com.

Once you have Ubuntu ISO image file, grab an empty USB disk and use UNetbootin to quickly turn that USB drive into a bootable Ubuntu disk for Ubuntu without having to burn a CD. Insert the bootable USB flash drive into your Windows computer and reboot. If this doesn’t work, go to the BIOS boot menu and change the boot sequence.
You should see an option at the boot menu that says “Try Ubuntu without any change to your computer” – choose that and you are good to go. Once inside Linux, you can install new programs, create files and everything else that you normally do at a computer though your changes won’t be written to the disk.
The Ubuntu portal has more details on creating and troubleshooting a LiveCD.

C: Run Linux in a Virtual Machine

The term virtualization may sound very geeky but in simple English, all it means is that you can another OS over an existing OS. For instance, you can run Windows on a Mac or you may install Linux on a Windows 7 machine using virtualization software.
To get started, download and install the free VMware Player on your Windows desktop. Then download the VMware image for Ubuntu and extract the zip file (I use PeaZip). Now double-click the Ubuntu.vmx file that you just extracted and the Linux virtual machine will load inside the VMWare Player. Simple!
Technically, Linux will be the “guest” operating system while “Windows” will be considered the host OS. And other than VMware, you may also VirtualBox to run Linux inside windows. The VirtualBox installer and the Ubuntu Linux images for VirtualBox for can be downloaded for free from oracle.com.

D: Install Linux like a Windows Software

Wouldn’t it be nice if you could install Linux like a native Windows app – something like Microsoft Office? For instance, if you have Office running on Windows, you can always uninstall the software later without affecting any other Windows programs or system settings.
Meet Wubi – short for Windows-based UBuntu Installer – a tiny utility that will help you install Ubuntu Linux alongside any other Windows application. Run the installer, choose a password for your Linux environment and the software does the rest.
It will download the necessary Linux ISO from the Internet and will install it on your machine. Alternatively, if you have previously download the ISO, you can just place the .iso file in the same folder as Wubi and it will pick it up.
Now the next time you restart / reboot your computer, it will offer you a choice of Linux (Ubuntu) and Windows. This is a real Linux installation and thus the overall performance should be good as well. If you ever want to uninstall Linux, simple boot into Windows, go to the Add-Remove problems and uninstall Wubi.

E: Run Linux inside the Web Browser

If you are just starting to learn Linux and are looking for an easy way to practice the various Linux commands, check out the very-impressive JSLinux project.
This is an emulator that lets you use Linux inside your web browser. You may write shells scripts using Sed and Awk, master regular expressions, play around with popular text editors like Vi and Emacs, look up man pages of various Linux command and much more – all inside your browser.

Kategori

Kategori