Skip to content

Instantly share code, notes, and snippets.

@eaybek
eaybek / fif
Last active September 28, 2015 17:33
run command for all file in a folder
#!/bin/bash
for f in $1/*
do
if [ -f "$f" ]
then
cmd=${2/__file__/$f}
$cmd
fi
done
@eaybek
eaybek / webscale
Last active September 28, 2015 21:21
resize a picture with aspect ratio and filled remain field
#!/bin/bash
base=$(basename $2)
filename="${base%.*}"
dir=$(dirname $2)
if ! [ -d "$dir/$1" ]
then
mkdir $dir/$1
fi
convert $2 -resize $1\> -size $1 xc:transparent +swap -gravity center -composite $dir/$1/$filename.png
#!/bin/bash
for f in $1/*
do
if [ -f "$f" ]
then
base=$(basename "$f")
filename="${base%.*}"
dir=$(dirname "$f")
mime=$(file --mime-type -b "$f")
mimedir=${mime/\//-}
@eaybek
eaybek / lssh
Last active January 31, 2017 14:10
list all bookmarks of ssh
#!/bin/sh
grep 'host ' ~/.ssh/config | sed 's/host /ssh /g'
U(){ echo $(( $1 || 0 )); }
#usage . /path/to/bashstep.sh
#!/bin/bash
sudo rm /var/crash/*
#if you add this line to your bashrc file before every command your terminal will change desktop and rise
export PROMPT_COMMAND='wmctrl -i -R $WINDOWID'
#if you add this line to your bashrc file before every command you change desktop and terminal will rise
# export PROMPT_COMMAND='wmctrl -i -a $WINDOWID'
style "xfdesktop-icon-view" {
XfdesktopIconView::label-alpha = 0 #yazının arkasındaki bölümün şeffaflığı 0 hiç görünmesin diye
XfdesktopIconView::shadow-x-offset = 2 # yazıya gölge
XfdesktopIconView::shadow-y-offset = 2 # yazıya gölge
XfdesktopIconView::shadow-color = "#000000" # gölge rengi
base[NORMAL] = "#000000" #yazının arkasındaki bölümün rengi
base[SELECTED] = "#000000" #seçili elemanlar için renk
base[ACTIVE] = "#000000" #aktif elemanlar için renk
/* Begin Here */
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_image = replace(link_image, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
/*UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl' OR option_name = 'widget_text' OR option_name = 'dashboard_widget_options';*/
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');
@eaybek
eaybek / meta-tags.md
Last active March 27, 2019 18:48 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags