gitlab ‘edit single file’ not working for files in subdirs (behind proxy)

If you use gitlab behind an apache proxy and can’t edit files that are in subdirs with the “Edit > edit single file” button (just loading circle) – here is the Problem: this happends because the proxy translates the ‘%2F’ in the URL paths!
You have to add “AllowEncodedSlashes NoDecode” to your proxy. here is a valid configuration:

Apache HTTP:

# Allow encoded slashes
AllowEncodedSlashes NoDecode

# Redirect all HTTP traffic to HTTPS
Redirect permanent / https://this-target/

Apache HTTPS:

# Proxy settings
ProxyPreserveHost On

# Allow encoded slashes
AllowEncodedSlashes NoDecode

# Proxy configuration
ProxyPass / http://gitlab-target:80/ nocanon
ProxyPassReverse / http://gitlab-target:80/

massping script

just a little script which pings a defined number of servers a defined time and give you the result. Good for looking if you connection is stable or if it may be an internet problem.

#!/bin/bash

targets=( 1.1.1.1 8.8.8.8 cloudflare.com discord.com )
max=100


tmpfile=$$.massping.tmp

# functions
f_ping(){
  v=$(ping -c $max $1 2>/dev/null|grep received|cut -d' ' -f4)
  echo $1 $v >> $tmpfile
}

f_done(){
  [[ ! -f $tmpfile ]] && echo false && return
  [[ $(wc -l $tmpfile 2>/dev/null|cut -d' ' -f1) -eq ${#targets[@]} ]] && echo true && return
  echo false
}

# main
for s in ${targets[@]}; do
  f_ping $s &
done

c=$max; echo
while [[ $(f_done) == false ]]; do
  echo -e "\e[1A\e[Kwaiting. This should need $c more seconds.."
  c=$(( $c - 1 ))
  sleep 1
done
echo -e "\e[1A\e[Kdone"; echo

maxline=0; for w in $(cat $tmpfile|cut -d' ' -f1); do [[ ${#w} -gt $maxline ]] && maxline=${#w}; done
spaces=""; while [[ $(( ${#spaces} + 1 )) -lt $maxline ]]; do spaces="$spaces "; done
echo "server${spaces}%"
IFS="
"
while read -r line; do
  server=$(echo $line|cut -d' ' -f1)
  count=$(echo $line|cut -d' ' -f2)
  perc=$(echo "scale=1; $count * 100 / $max"|bc)
  spaces=""; while [[ $(( ${#spaces} + ${#server} - ( 5 - ${#perc} ) )) -lt $maxline ]]; do spaces="$spaces "; done
  echo "${server}${spaces} ${perc}"
done < $tmpfile

[[ -f $tmpfile ]] && rm -f $tmpfile

exampleoutput:

server             %
1.1.1.1        100.0
8.8.8.8        100.0
cloudflare.com  99.0
discord.com     85.0

C# Net 5 Process terminated. Couldn’t find a valid ICU package installed on the system

Program compiled with net 5 as single file for linux.
You get this error:

Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.TextInfo..cctor()
   at System.Text.EncodingHelper.GetCharset()
   at System.Text.EncodingHelper.GetEncodingFromCharset()
   at System.ConsolePal.GetConsoleEncoding()
   at System.ConsolePal.get_OutputEncoding()
   at System.Console.get_OutputEncoding()
   at System.Console.CreateOutputWriter(System.IO.Stream)
   at System.Console.<get_Out>g__EnsureInitialized|25_0()
   at System.Console.get_Out()
   at System.Console.WriteLine(System.String)
 [...]
Abgebrochen (Speicherabzug geschrieben)

This fixed it for me:

export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

portforwarting over ssh

To use SSH tunneling in Linux, you need to provide your client with the source and destination port numbers, as well as the location of the destination server. The location can either be an IP address or a hostname.

The basic syntax for a local port forward command is straightforward:

ssh -L <local_port>:<target_server>:<targetport> <user>:<ssh_server> -p<sshport>

source: [link]

Must see movies

Filme die man meines Erachtens mindestens 1x gesehen haben sollte. Die Aufzählung folgt keiner bestimmten Reihenfolge.

repair grub2 on software-raid system

Assumptions:
– fs / is on /dev/md2
– fs boot is on /dev/md1
– you are using 2 harddisks (sda, sdb)
– you are using grub2
– grub2 is nor working (fe: error: symbol ‘grub_calloc’ not found.)


First boot your system with a rescue-disk/livecd. Then:

# mount /dev/md2 /mnt
# mount /dev/md1 /mnt/boot
mount --bind /proc /mnt/proc/ ; mount --bind /dev /mnt/dev/ ; mount --bind /sys /mnt/sys/
# chroot /mnt
# grub2-install /dev/sda   # or /dev/nvme1n1 - depends on your disks :)
# grub2-install /dev/sdb

you should see “Installing for i386-pc platform. Installation finished. No error reported.”

reboot.