Configure Tor with Bridge in Ubuntu

sudo apt-get install tor

After runing tor you can see the log of the tor by

journalctl -exft Tor

If the service started without errors, look at the Tor log

sudo journalctl -b --no-pager /usr/bin/tor
sudo apt install obfs4proxy

then you should get the bridge line. for get the bridge line go to https://bridges.torproject.org/ and get your bridge line.

nano /etc/tor/torrc
UseBridges 1 
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy 
Bridge obfs4 132.145.63.40:47347 5C72EEEE587AB1C7021A78707DAB80427F7A9B43 cert=HAZq1DmA4kR1/IFy1TBeSd67BNQI4SDur+U3zxun+G7HCWJ+x66eUyM6/sariPQYDJ9aIw iat-mode=0
Bridge obfs4 132.226.205.56:1991 6CA77FBE6752502259A3D0079F1C510663166404 cert=yrWZOUqsfQ9IyCj3LFwXSqFqbh+59S+1P9yPh/obHt4fbVYrE3ypGthX/+ZvM207I3xIBQ iat-mode=0
Bridge obfs4 45.33.1.189:9123 F9DFF618E7BA6C018245D417F39E970C2F019BAA cert=mDZuXuqSTjX1OjN7zLybTYzNi0A21A7G0DRNmW79029cSvLYSOk/KhGftcnmxruTmhRfZQ iat-mode=0
systemctl restart tor.service

References
https://askubuntu.com/questions/1183145/how-can-i-configure-tor-with-bridge-and-privoxy-to-proxy-entire-system
https://askubuntu.com/questions/607961/error-with-tor-in-ubuntu14-04

Install GitHub Desktop on Ubuntu

wget -qO - https://mirror.mwt.me/ghd/gpgkey | sudo tee /etc/apt/trusted.gpg.d/shiftkey-desktop.asc > /dev/null
# if you want to use packagecloud.io
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/shiftkey/desktop/any/ any main" > /etc/apt/sources.list.d/packagecloud-shiftkey-desktop.list'

# if you want to use the US mirror
sudo sh -c 'echo "deb [arch=amd64] https://mirror.mwt.me/ghd/deb/ any main" > /etc/apt/sources.list.d/packagecloud-shiftkey-desktop.list'
sudo apt update && sudo apt install github-desktop

References
https://github.com/shiftkey/desktop

Install GitHub CLI on Ubuntu

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
sudo apt update
sudo apt install gh

References
https://github.com/cli/cli/blob/trunk/docs/install_linux.md

Installing .NET 6 on Ubuntu 22.04

sudo apt update && sudo apt install -y wget
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo touch /etc/apt/preferences
sudo nano /etc/apt/preferences

Paste :

Package: *
Pin: origin "packages.microsoft.com"
Pin-Priority: 1001
sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-6.0
dotnet --info

References
https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204
https://github.com/dotnet/core/issues/7699

Turn off Wireless power management permanently in Ubuntu 22.04

sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

And change wifi.powersave to 2

or

sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/*

Possible values for the wifi.powersave field are:

NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
NM_SETTING_WIRELESS_POWERSAVE_IGNORE  (1): don't touch existing setting
NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
NM_SETTING_WIRELESS_POWERSAVE_ENABLE  (3): enable powersave

References
https://askubuntu.com/questions/1403773/22-04-wifi-keeps-disconnecting-for-a-few-seconds-frequently
https://unix.stackexchange.com/questions/269661/how-to-turn-off-wireless-power-management-permanently

Compile Bash Script into Binary in Linux

sudo apt install shc

Compile script file using shc

shc -f hello.sh

Check generated files

ls -l hello*
-rw-rw-r-- 1 user user    29 Mar 14 07:37 hello.sh
-rwxrwxr-x 1 user user 14960 Mar 14 07:39 hello.sh.x
-rw-rw-r-- 1 user user 10047 Mar 14 07:39 hello.sh.x.c

.sh is the original script.
sh.x is the compiled binary.
.sh.x.c is the C source code generated from the .sh file prior to compiling to .sh.x.

hello.sh.x permission is automatically set as executable

Rename executable

mv hello.sh.x hello

Check file execution

./hello Alice

References
https://www.simplified.guide/bash/compile-script