Saturday, May 23, 2020

Como ejecutar comandos con sudo cuando dice "sudo: comando_X: command not found"


Crear un alias en .zshrc o .bashrc con la siguiente opción:

alias sudo='sudo '

Esto permite el uso de alias con el sudo comandos.

Wednesday, October 24, 2012

Music on Console (MOC) Shortcuts

Start playing a track                                                         Enter
Pause track                                                                        Space or p
Play next track                                                                   n
Play previous track                                                            b
Switch from playlist browsing to filesystem browsing   tab
Add one track to the playlist                                            a
Remove track from playlist                                               d
Add a folder recursively to playlist                                  A
Clear playlist                                                                      C
Increase volume 5%                                                           . (dot)
Decrease volume 5%                                                          , (comma)
Increase volume 1%                                                           >
Decrease volume 1%                                                          <
Change volume to 10%                                                      meta + 1
Change volume to 20%                                                      meta + 2
Quit player                                                                         q
Shut down the server                                                       shift (capital) Q key or
                                                                                           mocp -x

Labels:

Friday, May 04, 2012

Chromium proxy


sudo vim /etc/chromium-browser/default



CHROMIUM_FLAGS="-proxy-server=direccion_proxy:puerto"


Sunday, April 29, 2012

Convirtiendo archivos ogg a mp3

No todos los reproductores mp3 tienen soporte ogg por lo que en ocasiones va a ser necesario cambiarlos de formato.

ffmpeg -i archivo.ogg archivo.mp3

y eso es todo.

Para todos los archivos en un directorio:

for name in *.ogg; do ffmpeg -i "$name" "$name.mp3"; done;

si su copia de FFmpeg no tiene soporte para mp3, puede instalar una versión que si lo tenga.

sudo apt-get install libavcodec-unstripped-52

Si se desea un bitrate mayor (de manera predeterminada ffmpeg utiliza 64k) este comando seria conveniente.

for name in *.ogg; do ffmpeg -ab 128 -i "$name" "$(basename "$name" .ogg).mp3"; done;



Fuente

Monday, September 13, 2010

Compartir directorio por HTTP por medio de Python

Primero ubicarce en el directorio que se va a compartir con el comando cd

escribir el siguiente comando:
$ python -m SimpleHTTPServer

Serving HTTP on 0.0.0.0 port 8000 ...

localhost.localdomain - - [18/Aug/2010 13:50:03] "GET / HTTP/1.1" 200 -

localhost.localdomain - - [18/Aug/2010 13:50:04] code 404, message File not found

localhost.localdomain - - [18/Aug/2010 13:50:04] "GET /favicon.ico HTTP/1.1" 404 -

El resultado es que si se abre un browser y se apunta la direccion ip del computador en el que se digito este comando en el puerto 8000 se va a ver el contenido del directorio que se compartió. Por ejemplo:
Resultados SimpleHTTPServer

Resultados SimpleHTTPServer

Opcionalmente se puede especificar un numero de puerto distinto del default (8000) simplemente agregandolo al final del comando, por ejemplo para utilizar el puerto 8500 el comando quedaria asi:
$ python -m SimpleHTTPServer 8500

Serving HTTP on 0.0.0.0 port 8500 ...

Para detener el servicio basta con digitar CTRL+C.
No sobra advertir que esta utilidad de Python debe ser utilizada con cuidado ya que podriamos exponer información delicada de manera inadvertida sin protección alguna.

Thursday, July 08, 2010

Reseteo Password Root

It is possible to boot a system and log on to the root account without knowing the root password as long as one has access to the console keyboard.

This is a procedure which requires no external boot disks and no change in BIOS boot settings. Here, "Linux" is the label for booting the Linux kernel in the default Debian install.

Solution 1

At the lilo boot screen, as soon as boot: appears (you must press a shift key at this point on some systems to prevent automatic booting and when lilo uses the framebuffer you have to press TAB to see the options you type), enter:

boot: Linux init=/bin/sh

This causes the system to boot the kernel and run /bin/sh instead of its standard init. Now you have gained root privileges and a root shell. Since / is currently mounted read-only and many disk partitions have not been mounted yet, you must do the following to have a reasonably functioning system.

init-2.03# mount -n -o remount,rw /
init-2.03# mount -avt nonfs,noproc,nosmbfs
init-2.03# cd /etc
init-2.03# vi passwd
init-2.03# vi shadow

(If the second data field in /etc/passwd is "x" for every username, your system uses shadow passwords, and you must edit /etc/shadow.) To disable the root password, edit the second data field in the password file so that it is empty. Now the system can be rebooted and you can log on as root without a password. When booting into runlevel 1, Debian (at least after Potato) requires a password, which some older distributions did not.

It is a good idea to have a minimal editor in /bin/ in case /usr/ is not accessible
Also consider installing the sash package. When the system becomes unbootable, execute:

boot: Linux init=/bin/sash

sash serves as an interactive substitute for sh even when /bin/sh is unusable. It's statically linked, and includes many standard utilities as built-ins.

Solution 2

Boot from any emergency boot/root disk set. If /dev/hda3 is the original root partition, the following will let one edit the password file just as easily as the above.

# mkdir fixit
# mount /dev/hda3 fixit
# cd fixit/etc
# vi shadow
# vi passwd

The advantage of this approach over the previous method is one does not need to know the lilo password . But to use it one must be able to access the BIOS setup to allow the system to boot from floppy disk or CD, if that is not already set.

Salva vida

Friday, March 05, 2010

Montar una unidad remota a través de SSH

Montar una unidad remota a través de SSH


1º -Instalar los paquetes:
aptitude install sshfs fuse-utils

2º- Cargar el módulo de fuse y lo meterlo en /etc/modules para que cargue al inicio:
modprobe fuse
echo fuse >> /etc/modules

3º- Dar permiso al usuario que montará la carpeta, estos permisos serán efectivos cuando cierre la sesión y vuelva a logearse en el sistema:
addgroup touzas fuse

4º- Crear un directorio en donde montar el directorio remoto e introducir el comando para montarlo:
mkdir /media/directorio_local
$ sshfs usuario_remoto@servidor_remoto:/directorio_remoto /media/directorio_local

Fuente
Enlace a lo proyecto Spread Open Media