view · edit · sidebar · attach · print · history

2.4.2020

  • Run cronjob for git pull and push
 cd /home/zeno/.software/covid19_ch
 git config credential.helper store

then the script

 #!/bin/bash
 cd /home/zeno/.software/covid19_ch
 export HOME=/home/zeno
 git pull
 git pull dd master
 git push

1.4.2020

  • Do not as for commit message at every step
 export GIT_MERGE_AUTOEDIT=no
  • Crop a PDF
 gs -o cropped.pdf -sDEVICE=pdfwrite -c "[/CropBox [24 600 800 650]" -c "/PAGES pdfmark" -f covid-19_ge_situation_31_03_20.pdf

31.3.2020

  • Extend your monitor with xrandr
 xrandr --output DVI-D-1 --auto --output DP-1 --auto --left-of DVI-D-1
  • Switch off left screen
 xrandr --output DP-1 --off

28.3.2020

  • Increase Virutal Harddisk Size
 qemu-img create -f qcow2 mac_hdd_90.img 90G
 virt-resize --expand /dev/sda2 mac_hdd.img mac_hdd_90.img
 https://mike42.me/blog/how-to-resize-a-windows-vm-image-with-virt-resize
  • Find large files on macOS
 sudo find / -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

26.3.2020

  • show mainboard on Linux
 sudo dmidecode -t 2

6.2.2020

  • awk, Resort by first column
awk -F ";" 'BEGIN { OFS = ";" } FNR==NR{a[$1]=$2;next} ($1 in a) {print $1,$2,$3,$4,$5,a[$1]}' drugshortage.txt zr_umsatz_absatz.csv > out.csv
  • -F is input delimiter
  • OFS is output delimiter
  • first file only contains PC
  • Output file contains 5 columns of second input file

24.1.2020

  • Append timestamp when copying files
 TIMESTAMP=$(date +%Y%m%d_%H%M)

20.1.2020

  • Comparing two files with awk and output non matching lines
 https://stackoverflow.com/questions/21415525/comparing-two-files-with-awk-and-output-non-matching-lines
 grep -vFxf file2 file1
  • Compare two files for matching lines and store positive results
 awk 'FNR==NR{a[$1];next}($1 in a){print}' file2 file1
 grep -Ff File2 File1
  • Remove leading zeros

http://www.unixcl.com/2010/04/remove-leading-zero-from-line-awk-sed.html

 :1,$ s/^[0]*//

16.1.2020

  • Find the largest files
 find -type f -exec du -Sh {} + | sort -rh | head -n 5

Verzeichnis nach Jahren

view · edit · sidebar · attach · print · history
Page last modified on April 03, 2020, at 10:58 AM