diff --git a/system-bin/rnetworking b/system-bin/rnetworking index 6be933e..96dbac3 100755 --- a/system-bin/rnetworking +++ b/system-bin/rnetworking @@ -15,18 +15,19 @@ restart_network() { if command -v ping > /dev/null; then # Check internet connection and if not OK then restart all networking services echo "Testing your connection..." - if ! ping -q -c 1 -W 1 9.9.9.9 > /dev/null || ! systemctl is-active openvpn-client@*.service > /dev/null; then + if ! ping -q -c 1 -W 1 9.9.9.9 > /dev/null || ! systemctl is-active openvpn-client@*.service > /dev/null || ! [ -d /proc/sys/net/ipv4/conf/tun0 ]; then # Delete bond interfaces if they exists if [ ! -z "$bond_active" ] ; then for bond_iface in "$bond_active"; do ip link delete $bond_iface - sleep 2 # time for the deletion before restarting network services + sleep 1 # time for the deletion before restarting network services done fi + # Kill openvpn + killall -9 openvpn # Restart services echo "Your connection is not working, restarting your network services: $services" - systemctl restart $services - if [ $? -eq 0 ]; then + if systemctl restart $services; then echo "Services restarted sucessfully, leaving." else echo "An error has occurred, make sure that service names are correct." diff --git a/user-config/bash_aliases b/user-config/bash_aliases index 5708eef..9f3eb5b 100644 --- a/user-config/bash_aliases +++ b/user-config/bash_aliases @@ -50,15 +50,15 @@ alias gcommit='git commit -m' alias ksignal='killall -9 signal-desktop' # Alias to get information about CPU - please use i7z -# alias cpufreq='watch -n 0.01 grep \"cpu MHz\" /proc/cpuinfo' -# alias cputemp='watch -n 0.01 sensors' +alias cpufreq='watch -n 0.01 grep \"cpu MHz\" /proc/cpuinfo' +alias cputemp='watch -n 0.01 sensors' # Alias to check what is my actual system IP using curl alias wtfip='dig +short myip.opendns.com @resolver1.opendns.com' # Alias to connect to ssh machines -alias assh='ssh vagrant@192.168.122.228' -alias bassh='ssh edu4rdshl@192.168.122.230' +alias assh='ssh edu4rdshl@192.168.122.228' +alias bassh='ssh root@192.168.122.230' alias dvwa='ssh dvwa@192.168.122.14' # Alias to start VirtualBox Machines in Headless mode @@ -80,7 +80,8 @@ alias pkgfile='pkgfile -v' # Alias for power management alias hibernate='systemctl hibernate' -alias shutdown='shutdown -n now' +alias shutdown='systemctl poweroff' +alias reboot='systemctl reboot' # Alias for going to a temporal dir alias cdtemp='cd $(mktemp -d)' diff --git a/user-config/bashrc b/user-config/bashrc index 051cf23..757462d 100644 --- a/user-config/bashrc +++ b/user-config/bashrc @@ -51,8 +51,15 @@ if [ -n "$force_color_prompt" ]; then fi fi +# colors +darkgrey="$(tput bold ; tput setaf 0)" +white="$(tput bold ; tput setaf 7)" +blue="$(tput bold; tput setaf 4)" +cyan="$(tput bold; tput setaf 6)" +nc="$(tput sgr0)" + if [ "$color_prompt" = yes ]; then - PS1='\[\033[0;32m\]\u\[\033[0;36m\] @ \h \w\[\033[0;32m\]$(__git_ps1)\n└─ ▶\[\033[0m\] ' + PS1='\[$blue\][ \[$cyan\]\H \[$darkgrey\]\w\[$darkgrey\] \[$blue\]]\[$blue\]$(__git_ps1)\n└─ ▶\[$nc\] ' else PS1='\u@\h:\w\$ ' fi @@ -116,7 +123,14 @@ export EDITOR="nvim" export VISUAL="nvim" # Fix DIR -PATH="$(ruby -e 'print Gem.user_dir')/bin:$HOME/.local/bin:$HOME/.local/share/osxcross/target/bin:$HOME/.cargo/bin:$PATH" +#PATH="$(ruby -e 'print Gem.user_dir')/bin:$HOME/.local/bin:$HOME/.local/share/osxcross/target/bin:$HOME/.cargo/bin:$PATH" +export PATH="$HOME/.local/bin:$HOME/.local/share/osxcross/target/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools:$PATH" + +# Output vscode telemetry +export DOTNET_CLI_TELEMETRY_OPTOUT=1 + +# Set TERM +export TERM=xterm-256color ### END OF SOME LOCAL VARIABBLES ### @@ -128,5 +142,5 @@ fi # Autostart X at login if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then - exec sx + exec startx fi diff --git a/user-config/i3/config b/user-config/i3/config index d29ea06..d96ef00 100644 --- a/user-config/i3/config +++ b/user-config/i3/config @@ -30,7 +30,7 @@ font pango:monospace 10 floating_modifier $mod # Use tabbed layout mode -# workspace_layout tabbed +workspace_layout tabbed # Disable mouse focus focus_follows_mouse no @@ -45,6 +45,8 @@ exec parcellite exec feh --bg-fill '/home/sechacklabs/Pictures/SHL/Nuevos Logos/shl-fin.png' # Keyring daemon exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +# Brightness +exec "xbacklight -set 50" # Battery icon, used to get notifications in battery critical level and more # exec cbatticon @@ -65,18 +67,17 @@ bindsym $mod+x exec gajim bindsym $mod+F3 exec pcmanfm # Firefox -# bindsym $mod+f exec firefox -bindsym $mod+f exec firefox-nightly +bindsym $mod+f exec firefox # SMPlayer bindsym $mod+p exec vlc -# Signal Desktop -# bindsym $mod+s exec "signal-desktop --disable-gpu" - # Discord bindsym $mod+d exec discord +# Signal +bindsym $mod+s exec "slack" + # Take screenshots bindsym Print exec "maim -s --format=png | xclip -selection clipboard -t image/png" bindsym --release Control+Print exec "image=`date '+%Y-%m-%d-%H%M%S'`-sechacklabs.png; scrot -s -z $image -e 'mv $f /home/sechacklabs/Pictures/Screenshots/'; xclip -selection clipboard -t image/png -i /home/sechacklabs/Pictures/Screenshots/$image" @@ -85,8 +86,8 @@ bindsym $mod+Print exec "image=`date '+%Y-%m-%d-%H%M%S'`-sechacklabs.png; scrot # Monitor brigthness -bindcode 233 exec xbacklight -inc 5 -bindcode 232 exec xbacklight -dec 5 +bindcode 171 exec "brightnessctl set 5%+" +bindcode 173 exec "brightnessctl set 5%-" # Volume control bindcode 123 exec "sink=$(pacmd stat | awk -F': ' '/^Default sink name: /{print $2}'); pactl set-sink-mute $sink false ; pactl set-sink-volume $sink +5%" @@ -238,3 +239,4 @@ bindsym $mod+r mode "resize" bar { status_command i3status } + diff --git a/user-config/i3status/config b/user-config/i3status/config index 5270c8e..706b917 100644 --- a/user-config/i3status/config +++ b/user-config/i3status/config @@ -8,9 +8,6 @@ general { colors = true - #color_good = "#b8bb26" - #color_bad = "#fb4934" - #color_degraded = "#fabd2f" separator = "" output_format = "i3bar" interval = 2 @@ -19,7 +16,7 @@ general { order += "path_exists VPN" order += "disk /" order += "disk /home" -#order += "disk /mnt/data" +order += "cpu_usage" order += "load" order += "memory" order += "cpu_temperature 0" @@ -46,9 +43,9 @@ disk "/home" { path_exists VPN { # path exists when a VPN tunnel is active - format = "🖧 OK" - format_down = "🖧 X" - path = "/proc/sys/net/ipv4/conf/tun0" + format = "🖧 ON" + format_down = "🖧 OFF" + path = "/proc/sys/net/ipv4/conf/tun0" } battery all { @@ -65,17 +62,22 @@ load { } memory { - format = "⚖️ %used | %available" + format = "⚖️ %used" threshold_degraded = "1G" format_degraded = "⛔ < %available" } cpu_temperature 0 { format = "🌡️ %degrees °C" + max_threshold = 80 format_above_threshold = "🔥 %degrees °C" - path = "/sys/devices/platform/coretemp.0/hwmon/hwmon[1-3]/temp1_input" + path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input" } tztime local { format = "🌎 %a %d %H:%M" } + +cpu_usage { + format = "💻 %usage" +} diff --git a/user-config/systemd-user-units/user/findomain.service b/user-config/systemd-user-units/user/findomain.service new file mode 100644 index 0000000..7f81126 --- /dev/null +++ b/user-config/systemd-user-units/user/findomain.service @@ -0,0 +1,12 @@ +[Unit] + Description=Monitor subdomains. + After=network-online.target + +[Service] + Type=simple + ExecStart=bash -c "findomain_virustotal_token='' findomain_fb_token='' findomain_discord_webhook='' findomain -f domains.txt -m" + KillMode=process + KillSignal=SIGINT + +[Install] + WantedBy=default.target diff --git a/user-config/systemd-user-units/user/findomain.timer b/user-config/systemd-user-units/user/findomain.timer new file mode 100644 index 0000000..68a7331 --- /dev/null +++ b/user-config/systemd-user-units/user/findomain.timer @@ -0,0 +1,10 @@ +[Unit] + Description=Check for new subdomains. + +[Timer] + OnBootSec=5min + OnUnitActiveSec=10min + Unit=findomain.service + +[Install] + WantedBy=timers.target