We always say that the most powerful Linux tools are its Command lines. This is because you can do about everything right from your command line. You can easily explain your computer exactly what you require and it comes back to you with appropriate results. Infact there are some commands that make this tool even more powerful! Here we bring to you a list of 10 such commands that work like energy drinks for you Linux machines!
Friday, April 25, 2014
10 Super Powerful Linux Commands
Thursday, April 24, 2014
Solving "perl: warning: Setting locale failed" in Ubuntu
It is happen because locale setting needs to be reconfigured. To do that, just type this in terminal
source
If it doesn't successfull, try to set locale firstsudo dpkg-reconfigure locales
and then type dpkg again.sudo locale-gen en_US en_US.UTF-8
source
Sunday, April 20, 2014
Install Squid Proxy Ubuntu Server
- Install Squid
sudo apt-get install squid
- Set squid to run after startup
update-rc.d squid3 defaults
- Open squid configuration file
sudo nano /etc/squid/squid.config
- Add this to the first line of squid.conf to use ipv4 only
dns_v4_first on
- Press Ctrl+w to search "http_access deny all"
- clear "#"
- Search "acl localnet" with Ctrl+w
- add line "acl localnet src your-ip-public"
- Press Ctrl+w to search "http_access allow"
- add line "http_access allow localnet"
- Press Ctrl+o and then press enter to save edited file
- restart squid service
NB:sudo service squid3 restart
- You can change localnet to whatever you want
- To change proxy port, search "http_port 3128" and change 3128 with port you want
Friday, April 11, 2014
How Priority Queue in Java is Working
Source Code
- import java.util.*;
- class PQ{
- static class PQsort implements Comparator<Integer>{ // inverse sort
- public int compare(Integer one, Integer two){
- return two - one; // unboxing
- }
- }
- public static void main(String[] args){
- int[] ia = {1,5,3,7,6,9,8}; // unordered data
- PriorityQueue<Integer> pq1 =
- new PriorityQueue<Integer>(); // use natural order
- for (int x : ia) // load queue
- pq1.offer(x);
- for (int x : ia) // review queue
- System.out.print(pq1.poll() + " ");
- System.out.println("");
- PQsort pqs = new PQsort(); // get a Comparator
- PriorityQueue<Integer> pq2 =
- new PriorityQueue<Integer>(10,pqs); // use Comparator
- for (int x : ia) // load queue
- pq2.offer(x);
- for (int x : ia) // review queue
- System.out.print(pq2.poll() + " ");
- System.out.println(" ");
- }
- }
Saturday, April 5, 2014
Backup and Restore Database MySQL
For backup all databases
mysqldump -u username -ppassword --all-databases > /tmp/alldatabases.sqlFor backup spesific database
mysqldump -u username -ppassword --databases databasename > /tmp/filename.sqlFor restore
mysql -u username -ppassword databasename < /tmp/filename.sql
Friday, April 4, 2014
Instaling Kubuntu Desktop without KDE Application
Just type this in terminal
sudo apt-get install --no-install-recommends kubuntu-desktop
Setting Proxy for apt-get in Ubuntu
- Open terminal
- Type this
sudo nano /etc/apt/apt.conf
- Add this line if there in no authentication in your proxy
Acquire::http::proxy "http://proxyserver:port/";
- Add this if there is authentication in your proxy
Acquire::http::proxy "http://username:password@proxyserver:port/";
- Press Ctrl+x and then press y
Subscribe to:
Posts (Atom)