Mostrar mensagens com a etiqueta Bash/Shell. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta Bash/Shell. Mostrar todas as mensagens

Special device /dev/fd0 does not exist!

If you have problems mounting a floppy drive in linux, you may be receiving the following message
"/ dev / tty is not a block device"  
"special device / dev/fd0 does not exist"  
"mount: you must Specify the file system"

If the device / dev/fd0 does not exist probably your module was not loaded at startup. For the load can do it as follows:  

# modeprob floppy  
 and then mount the drive:  
# mount-t vfat /  dev/fd0 / mnt / floppy 
(do not forget to create the floppy directory)

Continuar a ler »»
0

Not Grep!

It gave me a way to list several times using the grep command to the contrary, this is to list the contents of a file that contains less lines given string. For it is only necessary the-v parameter as shown below: 
# cat file.txt | grep-v "exclude".

Continuar a ler »»
0

Configure a network interface with ifconfig

May eventually need to configure a network interface in a very quick but not permanently.To do so can use the ifconfig command as follows:

ifconfig eth0 192.168.10.200 netmask 255.255.255.0

If you do not know what is the interface or if you want to check if the configuration iscorrect, they can simply run ifconfig.

After configuring the IP is to configure the gateway (gateway). In this case we will do isadd a route to route network packets to the gateway:

route add default gw 192.168.10.254

Continuar a ler »»
0

Saving energy on Linux

If you have a PC or a server passing of the time with no activity on the disk, can save a little on the electricity bill if the halt. It's true that can make configuring power management on your desktop environments (KDE, Gnome, etc.) but what I present here is a simple and rapid method for manually configuring this mechanism, ie the operating system Bash.
The tool to use hdparm is used to but to suspend the operation of hard disks can also adjust parameters of cache, DMA, or even acoustic noise, among others.

- Installation: aptitude install hdparm  
- Suspend for 2 minutes: hdparm-S 24 /dev/ sda
- Check the condition of the disk: hdparm -C /dev/sda
- Configure the permanent suspension: vim /etc/hdparm.conf - And add at end of file the following code:  
/dev/sda {
       
spindown_time = 24  

}  
- Then you just have to restart your PC, or the service - /etc/init.d/hdparm reload 

Note: the sda is the disk ID in Linux, in your case is hard to see that they have, they can do it as fdisk-l and then with the tool Partition Editor (GParted). If you have only one SATA disk to start is sda if hda is an IDE. If they are not much inside it, then I suggest you to search or ask here on the blog:)

Continuar a ler »»
0

Concatenate split files of type 001, 002

Today I leave you here a very simple way to concatenate files split, where normally the extension is 001, 002, 003, etc..
 

These files are very common in RapidShare or services of that kind.
 

My preferred way:  
cat ficheiros_divididos.avi.??? > Ficheiro_concatenado.avi

In this second way that I present have to be careful not to have divided other files in the directory where:  
cat *. [0-9] [0-9] [0-9]> ficheiro_concatenado.avi


Continuar a ler »»
0

find files by user identifier (user id - uid)

If you have a file server to Linux, certainly have needed to find files of a particular user, or its UID or GID, or even by your username. Here is this article, some examples of how futilizar the find command for this and other effects more basic.


Find files by user identifier (UID)?
find. /-uid 502

For user name:
find. / user-joselito

For identifier then the group (GID):
find. /-gid 1000

Locate all files with extension. Doc:
find. /-iname "*. doc"
find. /-name "*. doc"

Find files that have changed in the last 24 hours:
find. /-name "*. doc"-mtime 0

Find files that have changed to 48:
find. /-name "*. doc"-mtime 1

Locate all files with permissions 777:
find. /-perm / 777

Find files that have changed to exactly 5 days:
find. /-mtime -7

Find files that have changed less than 5 days:
find. /-mtime 5

Find files that have changed to more than 5 days:
find. /-mtime +5


Note: The difference between the parameter name and iname is that the latter is case sensitive - distinguishes the case matching. The parameter. / Indicates that the search is performed from the directory where you are.

Continuar a ler »»
0

learn more about the hardware pc

lsusb - list USB devices.

lspci - lists the PCI interface.

lscpu - Returns information about the CPU (architecture, quantity, model, intel / amd / other).

lsof - shows all open files by the system.
lsof-u root - Returns only the files opened by root.

lsmod - Lists modules loaded by the operating system.

lsattr - Make a list of the directory where seencontra, showing all the attributes of the files it contains.

dmidecode - Displays information about the system's hardware type, manufacturer, serial number, BIOS version, among others.
dmidecode | grep BIOS
dmidecode | grep Serial
dmidecode | grep Manufacturer

biosdecode - Return all information related to the BIOS.


Continuar a ler »»
0



The youtube-dl is a small command-line utility that can download videos from youtube.com too easily.
In terms of archives, from the Debian Multimedia already incorporates the youtube-dl. If it does not, download it here:)

Installation via apt
aptitude install youtube-dl

Use simple
youtube-dl Endereço_do_video_do_youtube (thus the name of the downloaded file is random)

Use advanced (in need of credentials)
youtube-dl-u USER-p PASSWORD Endereço_do_video_do_youtube

Use advanced (once assigned a name to the file)
youtube-dl-o filename Endereço_do_video_do_youtube

Help
youtube-dl - help

You leave here to take some videos to test this utility. These videos are a great concert, a great band, I was watching this month in the southwest, Faith No More:

"Evidence, all sung in Portuguese by Mike Patton"
http://www.youtube.com/watch?v=hAcvqSyCYhk

"Just a Man - Spectacular, Mike Patton comes to the public"
http://www.youtube.com/watch?v=VqVjYJsYXH0

"Easy"
http://www.youtube.com/watch?v=utCc7kj5RsA

"Mike Patton saying a stupidity in Portuguese language"
"Mike Patton calling King Kong a bearded"
"Joke"
http://www.youtube.com/watch?v=niD5hdFO0ZY

"Joke, with better quality"
"Mike Patton to say "Muito Tomântico"
http://www.youtube.com/watch?v=0zv6AoloFgg

"Music of entry, reunited"
http://www.youtube.com/watch?v=qv5bWk_EdAA

But if you want more, nothing like going to youtubas:) it is still well worth!

References
http://bitbucket.org/rg3/youtube-dl/wiki/Home

Continuar a ler »»
2

Disable sudo (If you please)

If you do not like (like me) to be always using the command "If you please" in Linux, ie "sudo", and then you must enter a user password! That sucks, does not believe?
So, to disable the password prompt when you switch to root, you can do the following:

1 - sudo visudo
# User privilege specification
root ALL = (ALL) ALL
(Uncomment the previous line)

2 - add your user to sudo group in /etc/group

3 - From now on, whenever the command line, just do sudo su, and not you are prompted password:)

Warning: The team Aventux, advises not make this change in servers, where security must be taken into account too. Now on workstations is not so serious, anyway, it is your account and risk.

Note: This was tested on Debian. I think that also works in this based distros (Ubuntu and others). Other non-Debian distributions also must have a very similar process.

To conclude let one more tip. After making the settings described above, to set up a shortcut menu of programs so that no password is requested, putting sudo before the command. I give the example of Synaptic. It always asks to start the root password, then you must edit the configuration of the shortcut and change the field where it says "Command: synaptic" to "Command: sudo synaptic".

Continuar a ler »»
0

Etiquetas

Seguidores

Popular Posts

Free Website Hosting