- Email: hdogan@vivaldi.net
- Resume: hdogan_resume.pdf
- Programmer Zone: Github, Stack Overflow
- Social Media: LinkedIn, Twitter
Contact
Eduroam Wireless Configuration
NetworManager
and its command-line tools should be installed.
$ nmcli con add type wifi ifname wlp1s0 con-name eduroam ssid eduroam
$ nmcli con edit id eduroam
nmcli> set ipv4.method auto
nmcli> set 802-1x.eap peap
nmcli> set 802-1x.phase2-auth mschapv2
nmcli> set 802-1x.identity username@unl.edu
nmcli> set 802-1x.password userpassword
nmcli> set wifi-sec.key-mgmt wpa-eap
nmcli> save
nmcli> activate
Continue reading →
isync + notmuch + emacs
This is my setup for emacs as email client. First, we need to install the required programs for password management (pass), mailbox synchronizer (isync), smtp client (msmtp), and mail indexer and tagger (notmuch, afew).
sudo pacman -S pass isync msmtp notmuch afew
Continue reading →
DWM Config
If you encounter misbehaving Java applications, add the following to your $HOME/.xinitrc
export _JAVA_AWT_WM_NONREPARENTING=1
Continue reading →
Moving files to subdirectories
If you have a directory with lots of files in it, this POSIX compliant Bash script is here to help you to move its files into subdirectories.
#!/usr/bin/env bash
echo "$(find . -type f | wc -l)" files
printf "How many subdirectories: "
read -r F
printf "Subdirectories prefix: "
read -r S
PARENT=${PWD}
n=0
for i in *
do
if [ $((n+=1)) -gt "$F" ]; then
n=1
fi
todir=$PARENT/"$S"_$n
[ -d "$todir" ] || mkdir "$todir"
mv "$i" "$todir"
done
Continue reading →
Bash Functions
I heavily use two bash functions I defined. listcols is for listing columns along with its column index, and prettycsv is for displaying delimited files nicely formatted in the terminal.
function listcols {
local arg sep
sep=","
while getopts 's:' arg
do
case ${arg} in
s) sep=${OPTARG};;
*) return 1 # illegal option
esac
done
shift $((OPTIND -1))
awk -F$sep '{for (i = 1; i <= NF; i++) print i":", $i; exit}' $@
}
Continue reading →