(defn

haluk-dogan

"Posts About Functional Programming, Machine Learning, and Linux"

[ Home About Archives RSS ]

Contact

Eduroam Wireless Configuration

October 19, 2020 | By Haluk Dogan

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

September 11, 2020 | By Haluk Dogan

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

September 7, 2020 | By Haluk Dogan

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

March 7, 2020 | By Haluk Dogan

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

September 30, 2019 | By Haluk Dogan

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 →

)

Copyright © Haluk Dogan