Notebook: for all those technical problems that I keep solving, however they keep showing up: pro-memoria


  vbell off
  hardstatus alwayslastline
  hardstatus string '%{gk}%{G}%H%{g}%= %{wk}%?%-Lw%?%{=b kW}%n*%f %t%?(%u)%?%{= kw}%?%+Lw%?%?%= %{g}%{Y}%l%{g}%{=b C} %c%{W}'
  autodetach on # Autodetach session on hangup instead of terminating screen completely
  startup_message off # Turn off the splash screen
  defscrollback 30000 # Use a 30000-line scrollback buffer
  termcapinfo xterm* ti@:te@  

 bash iterate line per line from text file, split by tab

We read line by line, the trick is to remove "\r" otherwise we can have problems using the strings. Also check what "%" is used for in bash.

while IFS=$'\t' read -r -a line
  line=${line%$'\r'} # make sure to remove "\r"
  echo ${line[0]} ${line[1]} ${line[2]} # field1, field2, field3 from line
done < ""

 replace comma by tab in text files

sed 's/\,/\t/g' file.csv

 git status hangs, if you have several untracked files

git status -uno
git commit -a -uno

 Apache authentication with folder listing

First create new file containing username and password:

htpasswd -c filename username

Then allow .htaccess to override directory options:

<Directory /var/www/folder>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
allow from all

And lastly, put a .htaccess inside your folder:

AuthType Basic
AuthName "Name"
AuthBasicProvider file
AuthUserFile /path/to/pass_file
Require user username
IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* SuppressHTMLPreamble