Foto batch resize and rename

Resize

Install the Nautilus extension

 sudo aptitude install nautilus-image-converter

Rename based on EXIF data

 exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls)

Generate strong passwords

Installing the tool

 $ sudo aptitude install apg

Using it - the simplest way

 $ apg

Entering some random data

 Please enter some random data (only first 16 are significant)
 (eg. your old password):>

Output

6 random passwords like this:

 Kaswaym3 (Ka-swaym-THREE)
 Nugbubrish9 (Nug-bubr-ish-NINE)
 Bydfust0 (Byd-fust-ZERO)
 DigCavpifob7 (Dig-Cav-pif-ob-SEVEN)
 OlbOrdUv4 (Olb-Ord-Uv-FOUR)
 CemKirEj4 (Cem-Kir-Ej-FOUR)

Create sftp only accounts on ubuntu server

Configuring OpenSSH

Edit the file /etc/ssh/sshd_config and change the line that starts with

 Subsystem sftp /.....

to

 Subsystem sftp sftp-internal /.....

and add following block at the end of this file:

 Match group filetransfer
   ChrootDirectory %h
   X11Forwarding no
   AllowTcpForwarding no
   ForceCommand internal-sftp

Finally restart OpenSSH

 /etc/init.d/ssh restart

Create the sftp only group

 addgroup filetransfer

Create a user and jail it into that group (no SSH login allowed for them)

 adduser username
 usermod -G filetransfer username

Latex


MAKE file

  1. PDFLATEX = pdflatex
  2. BIBTEXT = bibtex
  3. MAKEINDEX = makeindex
  4. PDFVIEWER = evince
  5. output_file = da-mracic-mapsu.pdf
  6. output_file_latest = da-mracic-mapsu-latest.pdf
  7. latex_main_file = doku
  8.  
  9. C_BLUE="`tput setb 1`"
  10. C_NORM="`tput op`"
  11.  
  12.  
  13. #-------------------------------------------------------------------------------
  14.  
  15.  
  16. all: $(output_file)
  17.  
  18. view:
  19.         $(MAKE) all
  20.         $(MAKE) clean
  21.         $(PDFVIEWER) $(output_file_latest)
  22.        
  23. clean:
  24.         $(RM) *.aux *.dvi *.ilg *.ind *.log *.lol *.out *.toc *.ps *.glo *.nlo *.ilg *.nls *.bbl *.blg

Git

Initialize local git repository and create origin master

Go to the root directory you want for this repo and execute following commands

 local$ git init

Create the repo on your server

 local$ ssh server
 server$ cd /path/to/git/root
 server$ mkdir newrepo.git && cd newrepo.git
 server$ git --bare init
 server$ exit

Add the origin master to your local git

 local$ git remote add origin ssh://server/path/to/repo.git
 local$ git push origin master

clone a git for local changes that can be pushed again to origin master

SSH login with key

Create ssh key on local computer

If you haven't already created a key to use, you can generate a RSA key with the following command

 ssh-keygen -t rsa

Add the key to the destination server

All you have to do is to copy the public part of your key onto the server's .ssh directory

 ssh-copy-id -i ~/.ssh/id_rsa.pub target.server.net

SpeakerProximity v.0.3.1 beta in the market

SpeakerProximity market linkI just published SpeakerProximity version 0.3.1 beta to the Market as a donate version.
SpeakerProximity This is an OpenSource app, the code and an APK is available on the Project page

Google opens Market for some more countries and allows merchant accounts for Developers

I got a mail from Mountain View today morning at 00:49 telling me about the new opened paid markets and to my surprise they allow merchant accounts for 20 more countries now.


Android Splashscreen


Howto implement a splashscreen in android

Frozen Egg
Frozen Egg - Market link
While working on the easter theme for Frozen Bubble (Frozen Egg => market://search?q=pname:ch.racic.frozenegg) I searched for a way to show a splashscreen while the app was loading.

The first implementation of a splash screen was to start a small activity that shows a splash image for a certain time period and the starts the main activity but this still shows the black screen while loading the main activity.
I remembered that toast messages can be customized and can contain images, thats my second implementation that I want to show to you.
Feel free to comment if you have better ways or ideas how to implement a splashscreen better.

Code listings after the break...

Frozen Egg

Frozen Egg
Frozen Egg - Market link
I made an easter theme for Pawel Aleksander Fedorynski's port of Frozen Bubble and published it to the market as Frozen Egg (market://search?q=pname:ch.racic.frozenegg).
All credits belong to him as I just edited the graphics file.

Syndicate content