Recovering files with errors skipping media errors (whatever media is CD, DVD, HD…)
This quick tip will not fix any phisical error in any file, but will help to copy it somewhere else.
(In Debian this commands comes in coreutils package)
user@debian-machine:~$ dd if=/path/to/file/origin of=/path/to/file/destiny cond=noerrors
Why this should work
Multimedia programs usually have problems playing files which present some kind of error accesing the media where the file is stored.
Although some of the bits lost could barely represent a frame of a film, the other BIG part is still there but the multimedia program stops or whatever. So, if we “move” the file from media this problems could disapear and we can still play and enjoy our lovely film.
PD: I wonder why I didn’t publish this before. I searched for it in the blog some days ago. Today, trying to release a bunch of draft post, I found it, weha!!
Etiquetas: cd error, dd, dvd error, errors, hd error, media, recovering error, recovering filesTe interesará:
Jump over private corporate proxy with Firefox (or git, or any SOCKS ready app) through a SSH tunnel
Thanks a lot to text producers. I’ve just copied it here to promote them.
Making the SSH tunnel
Option 1: SSH and direct connect (SOCKS5) : The following line will start the SSH client and connect to username@remote_machine.com. Port 8080 on localhost (127.0.0.1) will listen for requests and send them to the remote machine. The remote machine will then send the packets out as if they originated from itself. The SSH options are in the man page of SSH, but to summarize them in order: Compression, SSH2 only, Quite, Force pseudo-tty allocation, Redirect stdin from /dev/null, and Place the SSH client into “master” mode for connection sharing.
SSH -C2qTnN -D 8080 username@remote_machine.com
Option 2: SSH to squid proxy (HTTP/SSL Proxy) : The following line will also start the SSH client and connect to username@remote_machine.com. Port 8080 on localhost (127.0.0.1) on the current machine will listen for requests and SSH tunnel them to the remote machine. On the remote machine SSH will forward the packets to localhost port 2020. If squid is listening on localhost port 2020 on the remote machine then all requests sent though the SSH tunnel will then be forwarded to squid. You can use squid to block ads and speed up web access. If you need assistance with squid, check out the Calomel.org Squid “how to” page.
SSH -C2qTnN -L 8080:localhost:2020 username@remote_machine.com
Using GIT through a SOCKS proxy
user@debian-machine:~$ cat /somepath/bin/proxy-wrapper
#!/bin/bash
# on Debian systems you will need netcat-openbsd package in order this options to work
nc -xPROXYMACHINE:PORT -X5 $*
user@debian-machine:~$ export GIT_PROXY_COMMAND=”/somepath/bin/proxy-wrapper”
user@debian-machine:~$ git clone git://git.debian.org/git/debian-eeepc/eeepc-acpi-scripts.git
Initialized empty Git repository in /blableblubla/codigo/git/eeepc-acpi-scripts/.git/
remote: Counting objects: 1050, done.
remote: Compressing objects: 100% (554/554), done.
remote: Total 1050 (delta 572), reused 848 (delta 475)
Receiving objects: 100% (1050/1050), 115.39 KiB | 37 KiB/s, done.
Resolving deltas: 100% (572/572), done.
Links and references
Etiquetas: corporate proxy, firefox, iceweasel, private proxy, proxy, socks, ssh, ssh tunnelTe interesará:
Charlas técnicas. Compartir el conocimiento es genial.
Imposible encontrar otra entrada con mayor calidad por palabra.
Academic Earth
Google Tech Talks
Para mí estos 2 enlaces tienen un valor difícil de calcular.
Sí, me encanta aprender, saber. Soy muy curioso.
PD: De momento recomiendo “Greg Kroah Hartman on the LINUX Kernel” y “The Clean Code Talks — Unit Testing”
Etiquetas: c++, charlas, computer science, computer talks, google talks, talksTe interesará:
Debian Eeepc 901: Mount SD card as part of root filesystem (like /var)
Back again? Time will answer.
Beginning September I couldn’t wait any longer and I decided to buy an eeepc 901. As one of those mobility and digital-ubiquity believers I am. Of course this acquisition will worth an article.
But what I want to explain right now is that today I’ve finally fixed one of those horrible errors that gets your frustration arise because you don’t find a good (google) search pattern or any valid solution.
My main problem
Previous acquisition phase there is always a documentation phase. There I found that Solid States Disk (SSD), in their firsts versions suffer from a write limit.
As I’m skeptical and ignorant in this hardware topic I “believe and panic” about it.
Solving the problem
Solving the write limit problem had a easy solution, a SD card where most often written/modified files will live. That means putting /var on that card-disk. That’s easy, just a simple move and link.
But what you don’t expect is that SD reader gets detected after mounting file systems which brokes boot sequence. If you have this kind of bad boot sequence, you have to re-init from command line after mounting by hand.
You should be having a message that looks like “Enter root pass for maintenance or enter crtl+enter to continue”
Remount and reinit by hand
root@miniyo:~$ runlevel (to know which runlevel you are)
N 1
root@miniyo:~$ mount /dev/YOUR SD CARD some-options
root@miniyo:~$ init 2 (as a common example)
Getting things donde, but properly
We have to regenerate our init kernel, so it loads USB devices as soon as posible.
Of course SD reader is connected through USB internally in eeepc
This is how my “pre kernel loading” modules file looks like now that everything works.
user@miniyo:~$ cat /etc/initramfs-tools/modules
# List of modules that you want to include in your initramfs.
#
# Syntax: module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
usbcore
ehci-hcd
uhci-hcd
usb-storage
enrgar@miniyo:~$ update-initrafms
References and links
- HOWTO - Mount SD card as part of the unionfs
- Summary of the Debian status of support for models 901, 1000 and 1000H
- SSD write limit problem
Te interesará:
Perdidos. Lost. Descargas de capítulos de la 5ª Temporada
Otro año más, la serie continua.
Si algo no podía pasar por alto era el regreso de perdidos. Como muchos ya sabréis la cosa va terminando, esta es ya la penúltima temporada.
Por cierto, los guionistas siguen siendo unos cabrones :D.
Gracias a todos aquellos que hacen posible que dispongamos de los vídeos y los subtítulos.
Como en temporadas anteriores, esta entrada se irá actualizando según se vayan emitiendo los capítulos.
~ Quinta Temporada/Fifth Season. Los vídeos/The videos ~
Aquí los enlaces a los vídeos. Con las voces en inglés. Podéis descargar los vídeos ya con vuestro programa P2P favorito. (Subtítulos más abajo)
- Perdidos - Lost - Episodio 05 x 01 Because You Left.HDTV.pushercrew.es.avi
- Perdidos - Lost - Episodio 05 x 02 The lie.HDTV.2HD.es.avi
- Perdidos - Lost - Episodio 05 x 03 Jughead.HDTV.xor.es.avi
- Perdidos - Lost - Episodio 05 x 04 The Little Prince.HDTV.xor.en.avi
- Perdidos - Lost - Episodio 05 x 05 This Place Is Death.HDTV.BitMeTV.es.avi
- Perdidos - Lost - Episodio 05 x 06 316.HDTV.xor.es.avi
- Perdidos - Lost - Episodio 05 x 07 The Life and Death of Jeremy Bentham.avi
- Perdidos - Lost - Episodio 05 x 08 Le Fleur.avi
- Perdidos - Lost - Episodio 05 x 09 Namaste.avi
- Perdidos - Lost - Episodio 05 x 10 He’s Our You.xor.avi
- Perdidos - Lost - Episodio 05 x 11 Whatever Happened, Happened.xor.avi
- A partir de aquí los capítulos son VERSIONES HDTV a 720p de resolución que ocupan 1 GB aprox.
- Perdidos - Lost - Episodio 05 x 12 Dead is Dead.720p.HDTV.ctu.mkv
- Perdidos - Lost - Episodio 05 x 13 Some Like It Hoth.720p.HDTV.ctu.mkv
- Perdidos - Lost - Episodio 05 x 14 The Variable.720p.HDTV.ctu.mkv
- Perdidos - Lost - Episodio 05 x 15 Follow the Leader.720p.HDTV.ctu.mkv
- Perdidos - Lost - Episodio 05 x 16 y 17 The Incident.720p.HDTV.DIMENSION.mkv
~ Quinta Temporada/Fifth Season. Los subtítulos/The subtitles. ~
Aquí los enlaces a los subtítulos en inglés y en español. Porque para gustos se hicieron los colores.
- Perdidos - Lost - Episodio 05 x 01 Because You Left.HDTV.pushercrew.es.srt
- Perdidos - Lost - Episodio 05 x 02 The lie.HDTV.2HD.en.srt
- Perdidos - Lost - Episodio 05 x 02 The lie.HDTV.2HD.es.srt
- Perdidos - Lost - Episodio 05 x 01 Because You Left.HDTV.pushercrew.en.srt
- Perdidos - Lost - Episodio 05 x 03 Jughead.HDTV.xor.es.srt
- Perdidos - Lost - Episodio 05 x 04 The Little Prince.HDTV.xor.es.srt
- Perdidos - Lost - Episodio 05 x 04 The Little Prince.HDTV.xor.en.srt
- Perdidos - Lost - Episodio 05 x 05 This Place Is Death.HDTV.BitMeTV.es.srt
- Perdidos - Lost - Episodio 05 x 06 316.HDTV.xor.en.srt
- Perdidos - Lost - Episodio 05 x 06 316.HDTV.xor.es.srt
- Perdidos - Lost - Episodio 05 x 07 The Life and Death of Jeremy Bentham.es.srt
- Perdidos - Lost - Episodio 05 x 08 Le Fleur.es.srt
- Perdidos - Lost - Episodio 05 x 09 Namaste.es.srt
- Perdidos - Lost - Episodio 05 x 10 He’s Our You.es.srt
- Perdidos - Lost - Episodio 05 x 10 He’s Our You.en.srt
- Perdidos - Lost - Episodio 05 x 11 Whatever Happened, Happened.es.srt
- A partir de aquí los capítulos son para VERSIONES HDTV a 720p de resolución
- Perdidos - Lost - Episodio 05 x 12 Dead is Dead.720p.HDTV.ctu.es.srt
- Perdidos - Lost - Episodio 05 x 13 Some Like It Hoth.720p.HDTV.ctu.es.srt
- Perdidos - Lost - Episodio 05 x 14 The Variable.720p.HDTV.ctu.es.srt
- Perdidos - Lost - Episodio 05 x 15 Follow the Leader.720p.HDTV.ctu.es.srt
- Perdidos - Lost - Episodio 05 x 16 y 17 The Incident.720p.HDTV.DIMENSION.srt
Referencias y enlaces:
- [vagos] Descarga directa de Perdidos (versiones TV y HDTV)
- [subtitulos.es] Descarga directa de subtítulos de Perdidos
- [espoiler.tv] perdidos - lost (guia capitulos, torrents, etc)
Te interesará:
El programa para Linux más pequeño posible
Una curiosidad que permitirá conocer los entresijos de un ejecutable en LINUX.
Lectura recomendable, aunque sea para una lectura rápida y a saltos. Cuenta cómo va optimizando el código para pasar de 3998 bytes a 45 bytes.
Referencias y enlaces
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for LINUX
Etiquetas: elf executables, linux ejecutables, linux elf, linux executables, programa más pequeño, tiny executableTe interesará:
¿Cómo deshacernos del aceite de freír?
Aprovechando que hoy es el día mundial del medio ambiente, consejo al canto.
El aceite sobrante de cocinar es un elemento peliagudo a la hora de “limpiar la cocina”. Muchos de los responsables de esta tarea doméstica (e industrial) deberían ser conscientes de las acciones que deben llevar a cabo y de las que no.
Hay que saber que está claro que el aceite de origen doméstico contamina el agua y no sólo para el consumo humano.
Hoy os lo vamos a poner muy fácil y simple. Primero con cosas que no hacer:
- NO, NUNCA tirar este aceite por el fregadero o el inodoro.
- NO, NUNCA meterlo en un recipiente con tapón y tirarlo en el contenedor de envases.
y ahora con acciones qué si se deberían llegar a cabo.
- SÍ, MUY RECOMENDADO acumularlo en un envase con tapón y depositarlo en un punto limpio.
[Muy recomendable leer el artículo original de Soitu y muy recomendable seguir su sección de medio ambiente.]
Yo por ejemplo en mi casa uso dos sistemas (curiosamente los comentados en el artículo de origen a esta entrada).
Cuando tengo aceite que he usado varias veces en la freidora (o lo que sea), lo vierto en un recipiente que tengo.
Si se trata de pequeñas cantidades que están mezclados con restos de freír cosas empanadas (o lo que sea) en la sartén, escurro bien el aceite en mi recipiente. Y sí, muy a mi pesar, lo restante lo tiro a la bolsa de basura normal recogiéndolo con papel de cocina (también se puede usar arena o serrín).
El día que lo llene lo llevaré al punto limpio, que lo tengo de camino (como casi todo el mundo supongo).
¿Y cual es mi recipiente?
Pues yo creo que lo más cómodo es usar los mismos envases en los que viene el aceite que compramos. Yo ahora mismo estoy usando una garrafa de 5 litros que gasté en su momento. La tengo ya por encima de un tercio.
¿Conocéis vosotros más pequeños consejos cómo estos?
Referencias y enlaces
- ¿Cómo deshacernos del aceite de freír?
- Nuestra sección de reciclaje, con información sobre puntos limpios
Te interesará:
Howto to intercommunicate processes in different(remote) machines through DBus
Introduction
In this post I’m going to try to connect two processes in different machines through DBus. The method is a little bit complex, so be patient if you try.
Also is to advert that this has been the result of 3 days of tests (reference1). So maybe this method may be improved with time and use reference2.
Tools (The actors)
- dbus
- gabriel
- socat
- libssh
- SSH
- your apps
Debian official packages are dbus libssh-2 socat
gabriel is not part of Debian yet (but I’ve build one for myself)
Knowledge (Actors curriculum)
In this section I will describe the basics about the tools we are going to use.
DBus. Extracted from DBus page:
D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a “single instance” application or daemon, and to launch applications and daemons on demand when their services are needed.
D-Bus supplies both a system daemon (for events such as “new hardware device added” or “printer queue changed”) and a per-user-login-session daemon (for general IPC needs among user applications). Also, the message bus is built on top of a general one-to-one message passing framework, which can be used by any two apps to communicate directly (without going through the message bus daemon). Currently the communicating applications are on one computer, or through unencrypted TCP/IP suitable for use behind a firewall with shared NFS home directories.
Gabriel is a simple utility to enable D-Bus clients to connect to a D-Bus daemon running on a remote machine, through SSH.
This is the main piece of this puzzle. If you are interested in understanding how it works you should take a look at socat and libssh. As I’ve had to take a look at code, and make some modifications, you should read it as a punishment.
Extracted from socat man page:
socat - Multipurpose relay (SOcket CAT)
socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be used for many different purposes. It might be one of the tools that one ‘has already needed´.
Libssh. Extracted from libssh page:
The SSH library was designed to be used by programmers needing a working SSH implementation by the mean of a library. The complete control of the client is made by the programmer. With libssh, you can remotely execute programs, transfer files, use a secure and transparent tunnel for your remote programs. With its Secure FTP implementation, you can play with remote files easily, without third-party programs others than libcrypto (from openssl).
You should know about SSH and about your application.
Architecture
Local host will run gabriel and your application.
Remove host will need a running SSH server, a running dbus server and will need socat installed and ready to use.
We need to run gabriel, that will act as a server that will connect our host to the remote host through SSH. After that gabriel will use this SSH connection to intercommunicate our local application with remote DBus applications by using socat.
Howto (Main action)
At the moment I’ve only achieved to connect a process using session-bus, I’m still testing until I get connection through system-bus which was my initial purpose.
After reading next information, you will be able to connect using session bus and system bus.
As I commented somewhere else, I’ve made some modifications on gabriel code. I needed some common parameters as SSH port (my virtualbox testing environment ), better help explanations or add a verbose output.
Gabriel establish a connection with the remote SSH and by socat commands it communicates with the remote DBus “environment”. You should administrate SSH parameters and Dbus parameters to gabriel.
user@machine:~/svn/gabriel/gabriel$ src/gabriel –help
Usage:
gabriel [OPTION...] - Gabriel
Help Options:
-?, –help Show help options
Application Options:
-h, –host=HOSTNAME Hostname or IP of the remote host
-p, –port-ssh=PORT-SSH SSH port on the remote host
-u, –username=USERNAME SSH username on the remote host
-w, –password=PASSWORD SSH password on the remote host
-m, –method=DBUS_TRANSPORT_METHOD The D-Bus transport method to use (TCP, UNIX, abstract-UNIX)
-b, –bind=HOSTNAME The bind-address to listen for D-Bus client connections on
-d, –bus-address=BUS_ADDRESS The DBus session bus address of the remote D-Bus daemon
-t, –port-tcp=PORT-TCP The TCP port to listen for DBus client connections on
-v, –verbose=VERBOSE Set verbosity level (3, 2, 1, 0, -1)=(packet,protocol,functions,important,none)
We have to put special attention to -d, –bus-address=BUS_ADDRESS because this info must be gotten from the REMOTE machine.
That address is the one used by processes to communicate through DBUS. It’s something “internal” and automatically done when you use DBus API/library. I’m going to show you where to get it.
DBUS_SESSION_BUS_ADDRESS, DBUS_SYSTEM_BUS_ADDRESS, DBUS_SYSTEM_BUS_DEFAULT_ADDRESS
Again, this info should be gotten from REMOTE machine.
At the moment I don’t know any nice command where to get this info.
We have two main options of DBus buses. System and Session (more info in DBus page).
If you need SESSION bus address, you can choose what it better fits you:
- You can can get it from process environment
- You can stole it from any other process suspicious from being involved in DBus activities…
- You can create your own dbus-daemon (which, actually, I don’t know if it uses it’s own BUS_ADDRESS)
If you need SYSTEM bus address, you can choose what it better fits you:
- You can can get it from process environment. If it’s not defined, take a look at /etc/dbus-1/system.conf where you should locate a string like <listen>unix:path=/var/run/dbus/system_bus_socket</listen>
- You can stole it from any other process suspicious from being involved in DBus activities…
Examples:
// C++ code
#include <stdio.h>
#include <stdlib.h>
char * env;
// env = getenv (”DBUS_SESSION_BUS_ADDRESS”);
env = getenv (”DBUS_SYSTEM_BUS_ADDRESS”);
if (env!=NULL){
cout << env << endl;
}
user@REMOTE-machine:~ $ grep -z BUS_ADDRESS /proc/2047/environ
HALD_RUNNER_DBUS_ADDRESS=unix:abstract=/var/run/hald/dbus-bonbZtoykd,guid=8b5aff565de0dc7c467fef414832dd98
This command gives you a dbus-daemon in your session with the one you can contact.
user@REMOTE-machine:~ $ dbus-daemon –session –print-address
unix:abstract=/tmp/dbus-j2npbTXDwD,guid=d69f66d43e354de5733e4a1a48335bd6
user@REMOTE-machine:~ $ grep unix /etc/dbus-1/system.conf
<listen>unix:path=/var/run/dbus/system_bus_socket</listen>
Howto (Main action): Back to local host
Those ugly unix:stri:ngs/asdkaj/numbers we have seen is what we need for -d, –bus-address=BUS_ADDRESS.
See a session example:
user@machine:~/svn/gabriel/gabriel$ src/gabriel -h localhost -p 2222 -d unix:abstract=/tmp/dbus-j2npbTXDwD,guid=d69f66d43e354de5733e4a1a48335bd6
Listening to D-Bus clients on: “unix:abstract=/tmp/gabriel”
bla ble blu bla
See a system example:
user@machine:~/svn/gabriel/gabriel$ src/gabriel -h localhost -p 2222 -d unix:path=/var/run/dbus/system_bus_socket
Listening to D-Bus clients on: “unix:abstract=/tmp/gabriel”
bla ble blu bla
The moment we have or gabriel server running we (may have nothing) need to set DBUS_XXX_BUS_ADDRESS. Many apps would use, or have, this environment variable to connect to a DBus instance and intercommunicate with other process.
This is is easy, DBUS_XXX_BUS_ADDRESS should be the address gabriel shows few instants after being launched.
When we have defined this environment variable (in command line) we can execute our app, and it will happily communicate with the remote DBus world.
Example:
user@machine:~/svn/dbusmm/trunk/examples/glib$ export DBUS_SESSION_BUS_ADDRESS=”unix:abstract=/tmp/gabriel”
user@machine:~/svn/dbusmm/trunk/examples/glib$ ./dbus-browser
dbus-browser is a program that uses a session bus.
Curiosity: DBus protocol messages interchanged
Modifying a couple of lines in gabriel can let you see DBus raw protocol messages. It’s a didactic info.
If you enable verbose code at least at level 2, you will get raw DBus protocol messages.
My modifications and hacks
Code will be publish under GLKM project page.
Links and references
- dbus site
- gabriel site
- socat site
- libssh site
- reference 1. (informational note, it had implied jumping into gabriel, libssh, and dbus code and testing with a virtualbox machine)
- reference 2. (personal note, take a look at “Securing traffic between two socat instances using SSL” article in socat page)
Te interesará:





Últimos comentarios