Converting videos with avconv on Linux

 IT, Linux  Kommentare deaktiviert für Converting videos with avconv on Linux
Jul 022014
 

The videos produces by my action cam are stored as *.mov files. These files are very large, so I wanted them to be converted to a better format (using a better container/codec). Ubuntu earlier provided a package named ffmpeg. This package was replaced by libav. Libav uses the codebase of ffmpeg. The installation of libav provides some tools for audio and video streams.

One ff these tools is avconv which converts audio and video files. To convert a file from mov to mpg4 you can use:

avconv -i myfile.mov -vcodec mpeg4 -acodec copy myfile.mp4

This will convert the video to mpeg4 and copy the audio stream. For my purpose I used the h264 codec. This codec is still under development because of some problems when using it for audio streams (also for audio streams in videos). Because I would like to remove the audio stream (the sound of my action cam is very bad) this codec is fine for me.

To convert a MOV file to mp4 using h264 codec (and removing the audio stream) you can use the following command:

avconv -i myfile.mov -vcodec h264 -an myfile.mp4

The parameter „-an“ will remove the audio stream from the video.

The file size of the generated mp4 file is round about just 1/4 of the origin mov file, but the quality is nearly the same.

Linux Script for resizing images / photos

 IT, Linux  Kommentare deaktiviert für Linux Script for resizing images / photos
Apr 112013
 

Hi there,

here a script that wl resize images (to 25% of original size) and moves the resized images o a folder called „25Prozent“:

#!/bin/bash

cd $1
echo "Starting Script for resizing Images to 25% of the origin size"
echo "Creating folder -> 25Prozent <-"
mkdir 25Prozent
echo "Folder created"
echo "*** Start resizing images ***"
for i in *.JPG;do convert $i -resize 25% -quality 95 25Prozent/$i;echo $i;done
for i in *.jpg;do convert $i -resize 25% -quality 95 25Prozent/$i;echo $i;done
echo "*** Finished resizing images ***"
echo "exit and good bye..."

Instead of

for i in *.JPG;do ....
for i in *.jpg;do ...

You can also use:

for i in $(find . -iname "*.jpg")

Thx to Timo for this information 😉

Connection to remote networks with (tox-) socks and proxychains

 IT, Linux  Kommentare deaktiviert für Connection to remote networks with (tox-) socks and proxychains
Feb 112013
 

To connect from your local workstation to a remote network through socks proxies you can use (tox-) socks.

ToxSocks is able to connect to a remote network with socks protocol, but in my case it only worked with exactly one socks proxy server. In my special case I had to connect through several „chained“ proxy servers. Example:

localhost  <–>  socksProxy1  <–>  socksProxy2   <—>  remoteNetwork

This was not working with socks stand alone. On Linux you can use „proxychains“ to make a connection chain with several (socks-) proxies.

Install Proxy-Chains:

user@laptop:~$ sudo yum install proxychains

Configure the proxies and the chain:

user@laptop:~$ vim /etc/proxychains.conf

I have defined 2 socks clients in one chain:

[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
#socks4 	127.0.0.1 9050
socks5		123.45.67.89 1080
socks5		234.123.23.123 1080

With that configuration your connection looks like this:

localhost  <–>  123.45.67.89  <–>  234.123.23.123  <–>  remoteNetwork

Now, how to use this? It’s quite simple: proxychains <command> <paramters>
Just place „proxychains“ in front of the command you would like to execute.

Examples:

Remote Desktop:

proxychains rdesktop -u <Domain>\<user> -p <password> -z -k de -g 1366x768 <ip>

Explanation:  „-z“  activates compression ,  „-k de“ sets the keyboard to german layout,  „-g 1366×768“ sets the Display Size. On a shell you have to escape with \.

 

Samba-Client / SMB:

proxychains smbclient -U <username>%<password> -W <workgroup> \\<ip>\<share>

Explanation: with this command you can connect via smb protocol to a samba share. You need to take your windows username, password, and the Windows Workgroup. On a shell you have to escape with \.

 

Install HP Printer (MultiFuncion Device – MFD) DeskJet 3050a on RHEL / Linux

 IT, Linux  Kommentare deaktiviert für Install HP Printer (MultiFuncion Device – MFD) DeskJet 3050a on RHEL / Linux
Jan 082013
 

For RedHat Enterprise Linux you need to install HPLIP manually:

http://hplipopensource.com/hplip-web/install/manual/distros/redhatenterprise.html

There is also the link to download the hplip-3.12.11_rhel-6.0.x86:64.rpm package.

Impotant: The hplip version that is provided by the RedHat Package manager is in version 3.10.9. That version DOES NOT support the DeskJet 3050a!

I used the installation manual from the link above. At Step 3 (Installing rpm package) I got the error :

file /usr/lib64/libhpip.so.0.0.1 from install of hplipfull-3.12.11-0.x86_64 conflicts with file from package hplip-libs-3.10.9-3.el6.x86_64

To solve this, I used the –replaceFiles parameter:

HP Lip

Then run

sudo hp-setup

Then you can find the printer by specifying the IP:

HP Device Manager - Setup

HP Device Manager - Setup

Using HP Printers and MultiFuctionDevices (MFD) with HPLIP

 IT, Linux  Kommentare deaktiviert für Using HP Printers and MultiFuctionDevices (MFD) with HPLIP
Jan 062013
 

I am using an HP Deksjet 3050 with the HP-LIP tool. I already described how to install an HP Printer, now I would like to show how to use that printer / MFD with the HP-LIP tools.

There are several ways to use the device. You can use the commandline, a web browser and the standard linux printing features. I will start with the command line.

Command Line features

You can see all the available commands:

HP-Lip commands

HP-Lip commands

You can find an overview and description on this website:

http://hplipopensource.com/hplip-web/tech_docs/man_pages/index.html

The command hp-scan allows you to directly scan from the command line.

The command hp-toolbox command starts a graphical user interface which allows you to see the status of your device, change settings, clean cartridges, etc.:

HP Device Manager - HP Deskjet 3050 j610 Series

HP Device Manager – HP Deskjet 3050 j610 Series

 

Web based Features

Another way to use your device is the web based user interface which is provided by the device itself. Open the IP Address of the device (in my case: http://192.168.178.29/)  and you can see the following screen:

HP Web Based User Interface

HP Web Based User Interface