Monday, June 17, 2013

Fixing the warning: W: Possible missing firmware /lib/firmware/rtl_nic/....

When I had upgraded some programs, I got the following warning:

W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-2.fw for module r8169

To fix it you only have to install the firmware-realtek

# aptitude install firmware-realtek

Source
http://forums.debian.net/viewtopic.php?f=7&t=82716 

Sunday, April 21, 2013

Play encrypted DVD

[CONTEXT]
Playing encrypted DVD, sometimes you can recieved a error message like
 libdvdread: Encrypted DVD support unavailable.

[WHEN] 
You want to play encrypted DVDs with Linux.

[HOW]
As root
Edit your /etc/apt/source.list, adding this line

 deb http://www.deb-multimedia.org wheezy main non-free

The first package to install is deb-multimedia-keyring.

# apt-get install deb-multimedia-keyring
Install the library  libdvdcss2
# apt-get install libdvdcss2

After this steps, your dvd's player will be able to play DVD

[SOURCE]
http://www.cyberciti.biz/faq/debian-linux-squeeze-installing-libdvdcss2-command/ 
http://www.deb-multimedia.org/ 

[OTHERS ALTERNATIVES]
http://theos.in/desktop-linux/linux-playing-encrypted-dvd/
http://www.cyberciti.biz/faq/howto-ubuntu-linux-playback-dvd/

Mount a remote file system using ssh

[CONTEXT]
Access a remote file system  
[WHEN] 
You want to transfer files from/to a server which you have a ssh access
[HOW]   
As root:
install fuse
#apt-get install fuse-utils sshfs ssh
and load its kernel module
#modprobe fuse
add your regular user to fuse's group
#adduser [your-user] fuse
(reboot the machine)
Now using your regular user:
Mount your remote directory:
$ sshfs [user@]host:[dir] mountpoint [options]
e.g.
$sshfs remote-user@remote.server:/remote/directory /home/user/remote/
(If you only put  ':' is going to be your default directory)
Then, you can manipulate your remote folder as a regular local folder.
Unmount your remote directory
$fusermount -u mountpoint
e.g.
$fusermount -u  /home/user/remote/


[SOURCE]
http://www.debianadmin.com/mount-a-remote-file-system-through-ssh-using-sshfs.html 

Tuesday, February 12, 2013

Give bash prompt an interactive value with a script

[CONTEXT]
Bash script to automatically give an interactive value to prompt.

[WHEN]
For instance, you need to execute a sudo command on user logon, and you need to do it through a script.

[HOW]
Edit a bash script with the following content:

#!/bin/sh

( echo 'P4ssw0rd
' ) | su - root -c "/sbin/rcnetwork restart"

Where:
P4ssw0rd is the password for root user
"/sbin/rcnetwork restart" is the command to execute as root user

Take special attention on the new line after the password on the bash script, and also on the single quotes.


[NOTE]
This is only for reference, you never should write out the root password on a plain text file.

Installing Latex packages in your home directory

  
[CONTEXT]
Without root access, we cannot put the packages or Latex's style files into the directory /usr/share/texmf/


[WHEN]
We want to install Latex package or style files for all our Latex documents but we are working in computers that we do not have root access.



[HOW] 
Create a private tex hierarchy

$mkdir  $HOME/texmf/tex/latex

Put in this directory all your class, style, and package Latex files.
For custom bibtex style files, create the directory texmf/bibtex/bst

$mkdir $HOME/texmf/bibtex/bst

and put your bst files into it.


After any modification of the $HOME/texmf directory, run the command:
$texhash

Source: http://www.math.uiuc.edu/~hildebr/tex/tips-customstyles.html

Monday, February 11, 2013

Installing the Nvidia Kernel module

As root type
# apt-get install module-assistant nvidia-kernel-common
# m-a auto-install nvidia-kernel${VERSION}-source
# apt-get install nvidia-glx${VERSION} 
and reboot
 
Source: http://wiki.debian.org/NvidiaGraphicsDrivers

Sunday, February 10, 2013

Download videos from YouTube.com

youtube-dl is a script to download videos from youtube
To install this script, type as root
#wget http://youtube-dl.org/downloads/2013.08.09/youtube-dl -O /usr/local/bin/youtube-dl
#chmod a+x /usr/local/bin/youtube-dl
and to update it

#youtube-dl --update

To download videos, just type youtube-dl and link direction, for example

$youtube-dl http://www.youtube.com/watch?v=hUYzQaCCt2o

Also you can use this script to extract the audio of theses vidios, for example

$youtube-dl --extract-audio --audio-format=mp3 -t http://www.youtube.com/watch?v=hUYzQaCCt2o

Source: http://rg3.github.com/youtube-dl/