linux flickr auto uploader

sudo perl -MCPAN -e 'install Flickr::Upload'

flickr_upload --auth

echo auth_token=<token> >> ~/.flickrrc
echo progress=0 >> ~/.flickrrc

via http://anbits.blogspot.com

#! /usr/bin/env /bash

help() {
    echo 'Runs flickr_upload on directories and subdirectories.'
    echo 'If no arguments, runs in current directory.'
    echo 'Tag is taken from directory name.'
}

DONEMARKER="flickr_upload_marker"

if [[ ($2 != "") && ($1 = "-d") ]]; then
    pushd "$2" > /dev/null
    echo `pwd`
    if [ ! -e $DONEMARKER ]; then
        pwd=`pwd`
        TAG=`basename "$pwd"`
        flickr_upload --tag "$TAG" *.jpg
        flickr_upload --tag "$TAG" *.JPG
        touch $DONEMARKER
    else
        echo "marker found \"$DONEMARKER\""
    fi
    popd > /dev/null
    exit 0
elif [[ $1 != "" ]]; then
    DIR="$1"
else
    DIR="`pwd`"
fi

help

pushd "`dirname $0`" > /dev/null
SCRIPTLOCATION="`pwd`"
popd > /dev/null

pushd "$DIR" > /dev/null
DIR="`pwd`"
popd > /dev/null

echo $DIR
find "${DIR}/" -type d -print0 | xargs -0 -I % $0 -d %

auth.log – session opened/closed for user root by (uid=0)

/etc/pam.d/common-session-noninteractive poszukaj linii z takim wpisem:

session required pam_unix.so

NAD tą odszukaną linijką dodaj nową z następującą zawartością:

session [success=1 default=ignore] pam_succeed_if.so service in cron quiet use_uid

via monter.techlog.pl/auth-log-session-openedclosed-for-user-root-by-uid0

Helvetica in Firefox

Replace ugly rendered helvetica font in /etc/fonts/local.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
        <!-- Font directory list -->
        <dir>/usr/local/winfonts</dir> 

    <!-- Replace Helvetica with Arial -->
    <match target="pattern">
        <test qual="any" name="family">
            <string>Helvetica</string>
        </test>
            <edit name="family" mode="assign" binding="strong">
                <string>Arial</string>
            </edit>
    </match>    

    <!-- Replace Times with Times New Roman -->
    <match target="pattern">
        <test qual="any" name="family">
            <string>Times</string>
        </test>
            <edit name="family" mode="assign" binding="strong">
                <string>Times New Roman</string>
            </edit>
    </match>

    <!-- Replace Palatino with Georgia -->
    <match target="pattern">
        <test qual="any" name="family">
            <string>Palatino</string>
        </test>
            <edit name="family" mode="assign" binding="strong">
                <string>Georgia</string>
            </edit>
    </match>        

</fontconfig>

via superuser.com, meiert.com

Managing .pacnew Files

Using Meld to Update Differences.
Using meld in a loop can be used to update configuration files. This
script will loop through the files one by one then prompt to delete
the .pacnew file.

#!/bin/bash
# Merge new *.pacnew configuration files with their originals

pacnew=$(find /etc -type f -name "*.pacnew")

# Check if any .pacnew configurations are found
if [[ -z "$pacnew" ]]; then
  echo " No configurations to update"
fi

for config in $pacnew; do
  # Diff original and new configuration to merge
  gksudo meld ${config%\.*} $config &
  wait
  # Remove .pacnew file?
  while true; do
    read -p " Delete \""$config"\"? (Y/n): " Yn
    case $Yn in
      [Yy]* ) sudo rm "$config" && \
              echo " Deleted \""$config"\"."
              break                         ;;
      [Nn]* ) break                         ;;
      *     ) echo " Answer (Y)es or (n)o." ;;
    esac
  done
done

from wiki.archlinux.org