lunes, marzo 06, 2017

Covert FLAC to MP3 from the terminal

how to convert flac to mp3 audio format on linux mint using the command console

first be sure to remove any space in the files name, the follow command will remove spaces and put instance an underscore character:
find -name "* *" -type f | rename 's/ /_/g'

now be sure you have installed flac and lame
sudo apt-get install flac
sudo apt-get install lame

now we are ready to convert all the flac files on teh folder to mp3:
for f in *.flac;do flac -cd $f |lame -b 192 - $f.mp3;done

lunes, febrero 20, 2017

Control SSH Session with Python

$ pip install pexpect

the script:
from pexpect import pxssh
import getpass
    s = pxssh.pxssh()
    hostname = raw_input('hostname: ')
    username = raw_input('username: ')
    password = getpass.getpass('password: ')
    s.login(hostname, username, password)
    s.sendline('uptime')   # run a command
    s.prompt()             # match the prompt
    print(s.before)        # print everything before the prompt.
    s.sendline('ls -l')
except pxssh.ExceptionPxssh as e:
    print("pxssh failed on login.")

domingo, enero 01, 2017

Sending command from one terminal to another

to get the terminals open:

$ who

to get current termnal:
$ tty

to send command to terminal /dev/pts/11

$ echo test >& /dev/pts/11

domingo, octubre 02, 2016

Desktop Remote Access with x11vnc

install x11vnc server

apt-get install x11vnc

from Client config putty to SSH access:

from client open TightVNC Viewer:

lunes, mayo 09, 2016

Raspberry Pi 3 (Static IP)

In the recent Jessie update, the network interfaces configuration has to be defined with the following steps:

$ sudo nano /etc/dhcpcd.conf

interface eth0
static ip_address=192.168.1.XX/24
static routers=
static domain_name_servers=

$ sudo reboot

jueves, abril 28, 2016

Bug on Google?

there is a strange figure (like a set of litlle snakes) that appears in firefox browser when you try to search from the google site the word gmail

It is a google fault? this also appears in internet explorer.

screenshot from Firefox 45.0.2:

screenshot from Internet Explorer 11: