2011. szeptember 17., szombat

Batch image resize and watermarking shell script

#!/bin/bash

WATERMARK="watermark700.png"
resize=2000

#Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast.
WATERMARKPOS=SouthEast

OPACITY=60
QUALITY=85

DIR="."

# "*****************************************"
# "* Image Resize and Watermarking Script  *"
# "*         By Krutant.com                *"
# "*        With some tweaks...            *"
# "*****************************************"

clear

echo
echo "This script will OVERWRITE the source files, so work on a copy!"
echo

if [ $# -eq 1 ]
then

    #-----if there is a parameter----
    DIR="$1"
    echo "Target directory: $DIR"

    else

    echo -n "No parameter, current directory is: "
    pwd
    echo

fi


read -p "Watermark with file \""$WATERMARK"\" & resize all images to width "$resize"? (y/n)  " prompt

if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]

then

 echo ""

 shopt -s nullglob


 for each in $DIR/*{.jpg,.jpeg,.JPG,.JPEG}

 do

  echo -n "Working on "$each" ..."

  convert -resize $resize "$each" "$each" >> /dev/null

  composite -gravity $WATERMARKPOS -quality $QUALITY -dissolve $OPACITY $WATERMARK "$each" "$each" >> /dev/null

  echo "[Done]"

 done


# ---

  echo ""

  read -p "Press Enter to exit ..."

else

 exit 0

fi

2011. július 27., szerda

If Ubuntu 11.04 installer fails / freezes at the very end of the installation

No user to log in / Empty user list
Ubuntu 11.04 telepítés megszakad a legvégén
Üres felhasználói lista

--- BOOT FROM LIVE CD/USB ---

1. Install GRUB2
http://www.webupd8.org/2011/06/boot-repair-fix-ubuntu-boot-issues.html

2. CREATE USER

Open Terminal

To list all volumes type:
>mount

Search for the target HDD UUID:
for example: 550e8400-e29b-41d4-a716-446655440000 (it will be different from this)

>chroot /media/550e8400-e29b-41d4-a716-446655440000/

>adduser somebody

RESTART

Log in with the previously created user
Open Terminal
Type:
>sudo su
>passwd
Enter new root password

Make yourself administrator at System/Administration/Users and groups.
Make sure everything is OK, language, encodings, time zone, etc.

Thx for help: dr-willis, nyu at #Ubuntu IRC

2011. június 2., csütörtök

Informatikai Biztonság Wiki

Informatikai Biztonság Wiki
13+1 lépés: hogyan kerüld el a vírusokat, kémprogramokat, lelassulást,
adatvesztést...

https://www.facebook.com/informatikai.biztonsag

"Senkiháziak kezében van az IT szakma..."

A SORBS nem érti, hogy miért rossz dolog a Yahoo szervereinek IP címét blokkolni néhány spam üzenet miatt, akár több ezer ember levelezését bénítva meg ezzel a lépéssel.
A Yahoo biztonsági problémákkal foglalkozó címére írva a munkatárs meg nem érti meg, hogy ez miért probléma. Ezek után mit várunk a felhasználóktól?