2014/04/30

Find recursively excluding directories

find . -not -path "*/.svn*"

Copy recursively excluding directories

# will exclude '.svn' from every subdirectory
rsync -av --progress src/ dest/ --exclude '.svn'

2014/04/25

Fedora: rpmfusion

su
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

2014/04/18

Refresh your page automatically

<meta http-equiv="refresh" content="nSeconds;URL">

Maximum z-index

var a = document.body.getElementsByTagName("*"); var zmax = 0; for(q in a){ try{ if(jQuery(a[q]).css("z-index") !== "auto" && zmax < jQuery(a[q]).css("z-index")){ zmax = jQuery(a[q]).css("z-index"); } }catch(e){ } } console.log(zmax);

2014/03/07

Resize images

Preserve ratio:
convert 1.png -resize 250x250 2.png

Don't preserve ratio:
convert 1.png -resize 250x250\! 2.png

2014/03/05

Manage yum repos

List repos:
# yum repolist

Disable/enable repo:
# yum-config-manager --disable/--enable local

Add remote repo:
# yum-config-manager --add-repo http://www.example.com/example.repo

Add local repo:
# vi /etc/yum.repos.d/local.repo
[local]
name=Local Repo
baseurl=file:///home/michael/Downloads
gpgcheck=0
enabled=1
# yum-config-manager --disable local
# yum install createrepo
# createrepo -v /home/michael/Downloads
# yum-config-manager --enable local

----------------------------------------------------

[ERROR]

# yum update
...
           Installing: kernel-devel-3.14.22-100.fc19.i686 (updates)
               kernel-devel-uname-r = 3.14.22-100.fc19.i686
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
kde-settings-kdm-19-28.fc19.noarch is a duplicate with kde-settings-kdm-19-23.fc19.noarch

# yum info kde-settings-kdm-19-28.fc19.noarch
...
Repo        : installed
From repo   : updates

# yum info kde-settings-kdm-19-23.fc19.noarch
...
Repo        : installed
From repo   : koji-override-0

# yum remove kde-settings-kdm-19-23.fc19.noarch
...
Running transaction
/var/tmp/rpm-tmp.uMYK1k: line 1: fg: no job control
error: %preun(kde-settings-kdm-19-23.fc19.noarch) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package kde-settings-kdm-19-23.fc19.noarch
  Verifying  : kde-settings-kdm-19-23.fc19.noarch                                                                                
Failed:
  kde-settings-kdm.noarch 0:19-23.fc19                                                                                                     Complete!

[SOLVED]

# rpm -e --nopreun kde-settings-kdm-19-23.fc19.noarch

# package-cleanup --dupes
Loaded plugins: auto-update-debuginfo, langpacks, refresh-packagekit