> Best blogg: commande line
Showing posts with label commande line. Show all posts
Showing posts with label commande line. Show all posts

Thursday, July 10, 2014

Install command line developer tools in OS X

Install command line developer tools in OS X

If you need access to programming tools on your Mac, there are several ways to go about installing them.
Install command line developer tools in OS X
Part of OS X is its powerful command-line interface, where a competent or even novice programmer can make use of a number of tools for configuring and customizing the system, and make programs and scripts

While OS X ships with a number of common commands, by default Apple does not include those that are used for checking out, compiling, and otherwise managing code for developing applications.

If you need these tools for some reason, then there are three ways you can get them on your Mac. The first is to install Apple's XCode developer suite, which is available via the Mac App Store for free. However, installing this will also include XCode itself, and despite its benefits, some people may not wish to have the entire Xcode suite installed on a system.
Command Line Tool downloads for OS X
The command line tools are available as standalone installer packages from the Apple Developer Web site. Screenshot by Topher Kessler/CNET
The next option is to download the latest command line tools from Apple's developer page. To do this, you simply need to log into the downloads section of the Apple developer site using an Apple ID. Here you can search for "Command Line Tools" to view all versions of the tools from Lion through Mavericks. These can then be downloaded as .dmg disk images and mounted, and you can then run the enclosed installer.
The last option is perhaps the easiest, which is to use the system's ability to install the command line tools on demand. This is done by an application in the Macintosh HD > System > Library > CoreServices folder called "Install Command Line Developer Tools." However, this program cannot be launched independently. To run, this program must be invoked by a service or application that calls for the use of the developer tools.
Command line developer tools install prompt in OS X

Install command line developer tools in OS X

In most cases, standard developer commands like "make," "gcc," "cc," "svn," "git" or Apple-specific tools like "xcode-select" or "xcodebuild" or "xcrun" will require these tools, so running these in some form will spur the system to launch the "Install Command Line Developer Tools" program.
Therefore, to install these tools, simply open the Terminal, type "make" or any desired common developer command, and press Enter, and then when prompted you can install the developer tools (an approximate 100MB download from Apple), and be up and running.

When installed, the developer tools will be placed in the Macintosh HD > Library > Developer directory, which you can peruse to see what exactly has been installed. To uninstall these tools, simply remove the "Developer" folder from the Macintosh HD > Library directory.

Monday, April 21, 2014

How to Reset / Remove / Bypass Forgotten BIOS or CMOS Password?



BIOS passwords are used to add some extra security to computers. You can either set a password to prevent access to BIOS settings or to prevent PC from booting.
But sometimes this extra security might become a pain when you forget the BIOS password or someone changes your system BIOS password intentionally.
But there is no need to worry. There are many known ways to reset / remove / bypass the password:

How to Reset / Remove / Bypass Forgotten BIOS or CMOS Password?

  • By removing CMOS battery
  • By using motherboard jumper
  • By using MS DOS command
  • By using software
  • By using Backdoor BIOS password
Now I'll try to explain each method one by one:
DISCLAIMER: This information is intended for experienced users. It is not intended for basic users, hackers, or computer thieves. Please do not try any of following procedures if you are not familiar with computer hardware. We'll not be responsible for the use or misuse of this information, including personal injury, loss of data or hardware damage. So use it at your own risk.
By Removing CMOS Battery:
CMOS_Battery.jpg

Almost all motherboards use a small coin sized CMOS battery to store all BIOS settings along with the password. To reset the password, unplug the PC, open the cabinet and remove the CMOS battery for approx. 15-30 minutes and then put it back. It'll reset all BIOS settings as well as the password and you'll need to re-enter all settings.
If it fails, then try to remove the battery for at least one hour.
By Using Motherboard Jumper:
Almost all motherboards contain a jumper that can clear all CMOS settings along with the BIOS password. The location of this jumper varies depending upon the motherboard brand. You should read your motherboard manual to check its location. If you don't have the manual then look for the jumpers near the CMOS battery. Most of the manufacturer label the jumper as CLR, CLEAR, CLEAR CMOS, etc.
When you find the jumper, look carefully. There will be 3 pins and the jumper will be joining the center pin to either left or right pin. What you need to do, is remove the jumper and join the center pin to the opposite pin. e.g. if the jumper joins center pin to left pin, then remove it and join center pin to right pin. Now wait for a few seconds and then again remove the jumper and join the center pin to left pin.
Make sure to turn the PC off before opening the cabinet and resetting the jumper.
By Using MS DOS Command:
This method works only if you have access to the system when its turned on because this method requires MS DOS. Open Command Prompt from Programs menu and provide following commands one bye one:
debug
o 70 2E
o 71 FF
quit
NOTE: The first character in the above commands is English alphabet "o" and not the number 0.
After providing the above commands, restart your system and it should reset the CMOS Settings along with the BIOS password.
If you are curious to know how it works? then let me explain the above commands:
In this method we are using the Debug tool of MS DOS. The "o" character present at first in these commands, outputs the values to IO ports. The number 70 and 71 are port numbers which are used to access CMOS memory. By providing FF value we are telling CMOS that there is an invalid checksum and it resets the CMOS settings as well as BIOS password.
By Using Software:
There are a few software which can also reset CMOS settings or BIOS password or both within a few clicks. But as stated above you should have access to a system which is turned on and should have access to MS DOS or MS Windows:
  • CmosPwd
  • KillCMOS
By Using Backdoor BIOS Password:
Some BIOS manufacturer put a backdoor password in BIOS which always works irrespective of what password you have set in BIOS. Its a master password which is used for testing and troubleshooting purposes.
AMI BIOS Passwords:
A.M.I.
AAAMMMIII
AMI?SW
AMI_SW
AMI
BIOS
CONDO
HEWITT RAND
LKWPETER
MI
Oder
PASSWORD
AWARD BIOS Passwords:
01322222
589589
589721
595595
598598
ALFAROME
ALLy
aLLy
aLLY
ALLY
aPAf
_award
award
AWARD_SW
AWARD?SW
AWARD SW
AWARD PW
AWKWARD
awkward
BIOSTAR
CONCAT
CONDO
Condo
d8on
djonet
HLT
J64
J256
J262
j332
j322
KDD
Lkwpeter
LKWPETER
PINT
pint
SER
SKY_FOX
SYXZ
syxz
shift + syxz
TTPTHA
ZAAADA
ZBAAACA
ZJAAADC
PHOENIX BIOS Passwords:
BIOS
CMOS
phoenix
PHOENIX
Misc Common Passwords:
ALFAROME
BIOSTAR
biostar
biosstar
CMOS
cmos
LKWPETER
lkwpeter
setup
SETUP
Syxz
Wodj
Other Manufacturer BIOS Passwords:
Biostar - Biostar
Compaq - Compaq
Dell - Dell
Enox - xo11nE
Epox - central
Freetech - Posterie
IWill - iwill
Jetway - spooml
Packard Bell - bell9
QDI - QDI
Siemens - SKY_FOX
TMC - BIGO
Toshiba - Toshiba
VOBIS & IBM - merlin
NOTE: All these passwords are case-sensitive and are changed from time to time by manufacturers.

Monday, March 10, 2014

Command-Line Tools for LPRng

 Printing Files

 Command-Line Tools for LPRng , reseausale.blogspot.com
Details on how to use the lpr command can be found in the LPRng Howto (/usr/share/doc/packages/lprng/LPRng-HOWTO.html#LPR). The following only covers some basic operations.

To print a file, you normally must enter lpr -Pqueuename filename. If you leave out the -Pqueuename parameter, the printing system defaults to the value of the environment variable PRINTER. The same is true for the commands lpq and lprm. See the manual pages of lpr, lpq, and lprm for more information.

The environment variable PRINTER is set automatically on login. Display its current value with echo $PRINTER. Change it to expand to another queue by entering export PRINTER=queuename.

6.4.1.2. Checking the Status

By entering lpq -Pqueuename, check the status of print jobs handled by the specified queue. If you specify all as the queue name, lpq displays information for all jobs in all queues.
With lpq -s -Pqueuename, tell lpq to display only a minimum of information. lpq -l -Pqueuename tells lpq to be more verbose.
With lpq -L -Pqueuename, lpq displays a detailed status report, which will come in handy when trying to track down errors.
For further information, see the manual page of lpq, and section /usr/share/doc/packages/lprng/LPRng-HOWTO.html#LPQ of the LPRng Howto.

6.4.1.3. Removing Jobs from the Queue

The command lprm -Pqueuename jobnumberremoves the print job with the specified number from the specified queue, if you own the job. A print job is owned by the user who started it. Display the owner and the job number of print jobs with lpq.
The command lprm -Pall all removes all print jobs from all queues for which you have the required permissions. root may remove any jobs in any queues regardless of permissions.
More information can be obtained in the manual page of lprm and in the LPRng Howto (/usr/share/doc/packages/lprng/LPRng-HOWTO.html#LPRM).

6.4.1.4. Controlling the Queues

The command lpc option queuename displays the status of the specified queue and allows changing it. The most important options are:
help
Display a short overview of the available options.
status queuename
Display status information.
disable queuename
Do not accept new jobs for the specified queue.
enable queuename
Accept new jobs for the specified queue.
stop queuename
Stop printing from the specified queue. If a job is being printed, it will be completed.
start queuename
Enable printing from the specified queue.
down queuename
Has the effect of disable and stop combined.
up queuename
Has the effect of enable and start combined.
abort queuename
Has the effect of down, but aborts all current print jobs immediately. Aborted jobs are preserved, however, and can be resumed after restarting the queue with up.
root permissions are required to control printer queues with the above commands. Options can be supplied to lpc directly on the command line (as in lpc status all). You can also run the program without any options, which starts it in dialog mode — it opens the lpc> command prompt. Then enter the options at the prompt. To leave the program, enter either quit or exit.
If you were to enter lpc status all, the output could look like this:
Printer        Printing Spooling Jobs Server Subserver
lp@earth        enabled  enabled    2    123       456
color@earth    disabled disabled    0   none      none
laser@earth    disabled  enabled    8   none      none
This gives the following information: Queue lp is completely enabled and holds two print jobs, one of which is being printed at the moment. Queue color, on the other hand, is completely stopped. Finally, the laser queue does not print at the moment, but jobs (there are currently eight of them) are still accepted for the queue and are accumulating in the spooler.
Further information can be obtained from the manual page of lpc and the LPRng Howto (/usr/share/doc/packages/lprng/LPRng-HOWTO.html#LPC).

6.4.2. Managing Remote Queues

For each of the commands explained below, replace <printserver> with the name or IP address of your print server. <queuename> must be a queue on the print server.

6.4.2.1. Printing Files

With the LPRng spooler, even remote queues can be addressed directly, using the lpr command with the syntax lpr -Pqueuename@printserver file. This is only possible if the print server is configured to accept remote print jobs on its queues. This is enabled by default with LPRng.

6.4.2.2. Checking the Status

Check the status of a queue on a remote host by entering:
lpq -P<queuename>@<printserver>
lpq -s -P<queuename>@<printserver>
lpq -l -P<queuename>@<printserver>
lpq -L -P<queuename>@<printserver>
and
lpc status <queuename>@<printserver>
lpc status all@<printserver>
To list the names of and display status information on all queues of a print server, use either lpq -s -Pall@printserver or lpc status all@printserver, provided that LPRng is used on the print server.
If printing over a remote queue does not work, querying the status of the queues helps determine the cause of the problem. If LPRng is installed on the print server, enter lpq -L -Pqueuename@printserver to get a detailed status report for remote diagnosis.

6.4.2.3. Removing Jobs from the Queue

With the following command delete all print jobs in remote queues that have been issued under your user name:
lprm -P<queuename>@<printserver> <jobnumber>
lprm -P<queuename>@<printserver> all
lprm -Pall@<printserver> all
root has no special privileges on remote queues. The parameter all only works if LPRng is used on the print server host as well.

6.4.3. Command-Line Tools for LPRng Troubleshooting

Print jobs are kept in the queue even if you shut down a machine during a printout so are still there after rebooting. To remove a faulty print job, use the commands described above. Rebooting will not remove them.
For example, it sometimes happens that the host-to-printer connection suffers some kind of fault, after which the printer is unable to interpret data correctly. This can cause it to spit out large amounts of paper with meaningless characters on it.
  1. In the case of an inkjet model, remove all paper from the trays. Open the paper tray if you have a laser model.
  2. In most cases, the print job is still in the queue after that. Print jobs are removed from the queue only after all data has been sent to the printer. Check with lpq or lpc status to see which queue is printing then delete the job in question with lprm.
  3. The printer may produce some output even after deleting the job from the queue. To stop this, use the commands fuser -k /dev/lp0 for a printer on the first parallel port or fuser -k /dev/usb/lp0 for the first USB printer to terminate all processes still using the printer device.
  4. Do a complete reset of the printer by switching it off. Wait a few seconds before putting the paper back into the trays and switching the device back on.

Monday, February 10, 2014

DNS Settings on Linux

  1. watch video

 2

Manual DNS

There may be times you need to change your server's DNS settings, either because you find they're misconfigured or because you want to use your own. Fortunately there isn't a lot of work involved in changing the DNS servers, just a quick edit in the right place.

resolv.conf

On Linux the DNS servers the system uses for name resolution are defined in the file:
/etc/resolv.conf
It's spelled just like that, with no "e" at the end of "resolv".
In that file we'll want to have at least one "nameserver" line (two is better, so we have a fallback). Each line defines a DNS server.
The name servers will be prioritized in the order the system finds them in the file. Use the IP addresses of the name servers when entering them, since the system won't know what to do with domain names until after it knows how to get to the DNS servers.
Open resolv.conf with an editor like nano to make the necessary changes (if it doesn't exist already this will create the file for us):
sudo nano /etc/resolv.conf

Rackspace Cloud Hong Kong

If your Cloud Server is in the Hong Kong (HKG) datacenter you should use:
nameserver 120.136.32.63
nameserver 120.136.32.62

Rackspace Cloud UK

If you're on Rackspace Cloud UK you can use our closest DNS servers by making the contents of the /etc/resolv.conf file read:
nameserver 83.138.151.80
nameserver 83.138.151.81

Rackspace Cloud USA - ORD

If your Cloud Server is in the US Chicago (ORD) datacenter you should use:
nameserver 173.203.4.8
nameserver 173.203.4.9

Rackspace Cloud USA - DFW

If your Cloud Server is in the US Dallas/Fort Worth (DFW) datacenter you should use:
nameserver 72.3.128.240
nameserver 72.3.128.241

Rackspace Cloud AUS - SYD

If your Cloud Server is in the Sydney, Australia datacenter you should use:
nameserver 119.9.60.63
nameserver 119.9.60.62

A quick test

Once you have your DNS servers set, save the file. And you're done. No reboot required.
The easiest way to make sure your new settings are good ones is to try to ping a domain name:
ping -c 3 rackspace.com
You should see a result like:
PING rackspace.com (173.203.44.122) 56(84) bytes of data.
64 bytes from 173.203.44.122: icmp_req=1 ttl=249 time=25.3 ms
64 bytes from 173.203.44.122: icmp_req=2 ttl=249 time=25.2 ms
64 bytes from 173.203.44.122: icmp_req=3 ttl=249 time=25.2 ms
 
--- rackspace.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 25.236/25.292/25.392/0.147 ms
If you get an "unknown host" message back you should double-check the IP addresses you set as your DNS servers.

IPv6

If you're using IPv6 on your server you may need to add the IPv6 addresses of your name servers to resolv.conf.  You can see if a DNS server has an IPv6 address with two steps.
First, use "host" to get the name of the server:
$ host 72.3.128.240
240.128.3.72.in-addr.arpa domain name pointer cachens1.dfw1.rackspace.com.
Then use the domain name you got back in another "host" lookup:
$ host cachens1.dfw1.rackspace.com
cachens1.dfw1.rackspace.com has address 72.3.128.240
cachens1.dfw1.rackspace.com has IPv6 address 2001:4800:d::1
If an IPv6 address is returned you can add that as another "nameserver" line in resolv.conf, as in:
nameserver 2001:4800:d::1
Then test as above, using the "ping6" command instead of the regular "ping" command to force the system to use IPv6.

Summary

It's that simple - change or add those name servers and once the settings are saved the system will use them right away. Make sure the changes take with a quick ping to test it and you'll be done.

Monday, December 30, 2013

basic linux commands

 basic linux commands

basic linux commands

hi guys, hiyou have installed your favorite linux distro and you are sitting in front of it. Probably you must have heard a lot of frightening things about its console. Here you will see some basic linux commands which will help you to get familiar with linux command line. So let's continue with the linux commands cheatsheet.
But first a few words about a very basic command called man. man comes from manual and it works like this man command_name. With this command you can view information on how to use any command of your system. There is even a man page for man! Try typing man man and you ll get the point. So if want further information and details on a command listed below just type man command_name
Lets get started!
 basic linux commands
basic linux command line

Viewing, copying, moving and deleting files

ls Display the contents of the current directory
ls -a Display also hidden files and hidden directories
cp filename /path/dir_name Copy filename into directory /path/dir_name
cp -r dir_name /path/dir_name2 Copy the entire dir_name into /path/dir_name2
cp filename1 filename2 /path/dir_name Copy filename1 and filename2 into /path/dir_name
rm name Remove a file or directory called name
rm -r name Remove an entire directory as well as its included files and subdirectories
mv filename /path/dir_name Move filename into /path/dir_name
mv filename1 filename2 Rename filename1 to filename2
cat filename Display filenames contents
more filename Display filename in pages. Use spacebar to view next page
head filename Display filenames first 10 lines
head -15 filename Display filenames first 15 lines
tail filename Display filenames last 10 lines
tail -15 filename Display filenames last 15 lines
pwd Display current directory
cd /path/dir_name Change to directory /path/dir_name
cd .. Go 1 directory up
mkdir dir_name Create directory dir_name
rmdir dir_name Delete directory dir_name
 

Finding files and text within files

updatedb Update (create first time used) a database of all files under the root directory /
locate filename Find file filename searching in the database
find / -name filename Starting from the root directory search for the file called filename
find / -name *filename Same as above but search for file containing the string filename
grep string /path/dir_name Starting from /path/dir_name search for all files containing string
which application_name Search $path for application app_name
whereis application_name Search $path, man pages and source files for application_name
  basic linux commands

Archived files

Decompress

tar -xzf filename.tgz Decompress tzg file
tar -xzf filename.tar.gz Decompress tar.gz file
tar -xjf filename.tar.bz2 Decompress tar.bz2 file
 
Compress
tar -czf filename.tar /path/dir_name Compress directory /path/dir_name to filename.tar
gzip -c filename > filename.gz Compress /path/dir_name to filename.tar.gz
bzip2 -c filename > filename.bz2 Compress /path/dir_name to filename.tar.bz2
  basic linux commands

Using rpm files 

rpm -hiv package.rpm Install rpm called package.rpm
rpm -hiv --force package.rpm Install rpm called package.rpm by force
rpm -hUv package.rpm Upgrade rpm called package.rpm
rpm -e package.rpm Delete rpm called package.rpm
rpm -qpil package.rpm List files in not-installed rpm called package.rpm
rpm -ql package.rpm List files in installed rpm called package.rpm
rpm -q str List installed rpms containing the string str
rpm -qf /path/application_name Display the rpm that contains application application_name
  basic linux commands

Starting and Stoping 

startx Start the X system
shutdown -h now Shutdown the system now and do not reboot
halt
Same as above
shutdown -r now Reboot
reboot Same as above
shutdown -r +10 Reboot in 10 minutes
    basic linux commands

Mounting filesystems

mount -t vfat /dev/sd(a)(1) /mnt/c_drive Mount the first partition 1 of the first hard disk drive a which is in fat32 vfat dormat under /mnt/c_drive directory
mount -t iso9660 /dev/cdrom /mnt/cdrom Mount cdrom under /mnt/cdrom directory
umount /mnt/hda1 Unmout the above
  basic linux commands

User administration

users Display users currently logged in
adduser username Create a new user called username
passwd username Define password for user called username
who List logged-in users
whoami Display current user
finger username Displays info about user username
su Log in as root from current login
su - Log in as root from current login and take root's path
exit Exit from console login (ie, logout).
  basic linux commands

Processes 

command Execute command in the foreground
command & Execute command in the background
ctrl+z Suspend a program
ctrl+c Interrupt a program
ps List all processes
kill -9 pid Kill process with id pid
top Monitor processes in real time
  basic linux commands

Networking 

hostname List the system's hostname
ifconfig Set/Display network information
host ip Resolves ip's hostname
ping ip/hostname Check if ip/hostname is reachable
traceroute ip/hostname Find network path to ip/hostname
  
 basic linux commands

System Information

uname -a General system information
fdisk -l List partition tables
cp filename /path/dir_name Copy filename into directory /path/dir_name
df -T -h List filesystem disk space usage
lspci List PCI devices
lsusb List USB devices
free -m Display RAM+Swap usage

 basic linux commands

Program Compile

gcc -o output file.c Compile a C program
./output Run a C program you have compiled
g++ -o output file.cpp Compile a C++ program
./output Run a C++ program you have compiled
./configure && make && su -c 'make install' Configure, compile and install a program with Makefile

Popular Posts

 

Copyright @ 2013 Best blogg.

Designed by Templateify & Sponsored By Twigplay