This commit is contained in:
Eduard Tolosa 2019-10-19 05:32:52 -05:00
parent 3f0fedf3bc
commit 8a6e99d13e
7 changed files with 71 additions and 29 deletions

View file

@ -15,18 +15,19 @@ restart_network() {
if command -v ping > /dev/null; then if command -v ping > /dev/null; then
# Check internet connection and if not OK then restart all networking services # Check internet connection and if not OK then restart all networking services
echo "Testing your connection..." 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 # Delete bond interfaces if they exists
if [ ! -z "$bond_active" ] ; then if [ ! -z "$bond_active" ] ; then
for bond_iface in "$bond_active"; do for bond_iface in "$bond_active"; do
ip link delete $bond_iface 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 done
fi fi
# Kill openvpn
killall -9 openvpn
# Restart services # Restart services
echo "Your connection is not working, restarting your network services: $services" echo "Your connection is not working, restarting your network services: $services"
systemctl restart $services if systemctl restart $services; then
if [ $? -eq 0 ]; then
echo "Services restarted sucessfully, leaving." echo "Services restarted sucessfully, leaving."
else else
echo "An error has occurred, make sure that service names are correct." echo "An error has occurred, make sure that service names are correct."

View file

@ -50,15 +50,15 @@ alias gcommit='git commit -m'
alias ksignal='killall -9 signal-desktop' alias ksignal='killall -9 signal-desktop'
# Alias to get information about CPU - please use i7z # Alias to get information about CPU - please use i7z
# alias cpufreq='watch -n 0.01 grep \"cpu MHz\" /proc/cpuinfo' alias cpufreq='watch -n 0.01 grep \"cpu MHz\" /proc/cpuinfo'
# alias cputemp='watch -n 0.01 sensors' alias cputemp='watch -n 0.01 sensors'
# Alias to check what is my actual system IP using curl # Alias to check what is my actual system IP using curl
alias wtfip='dig +short myip.opendns.com @resolver1.opendns.com' alias wtfip='dig +short myip.opendns.com @resolver1.opendns.com'
# Alias to connect to ssh machines # Alias to connect to ssh machines
alias assh='ssh vagrant@192.168.122.228' alias assh='ssh edu4rdshl@192.168.122.228'
alias bassh='ssh edu4rdshl@192.168.122.230' alias bassh='ssh root@192.168.122.230'
alias dvwa='ssh dvwa@192.168.122.14' alias dvwa='ssh dvwa@192.168.122.14'
# Alias to start VirtualBox Machines in Headless mode # Alias to start VirtualBox Machines in Headless mode
@ -80,7 +80,8 @@ alias pkgfile='pkgfile -v'
# Alias for power management # Alias for power management
alias hibernate='systemctl hibernate' 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 for going to a temporal dir
alias cdtemp='cd $(mktemp -d)' alias cdtemp='cd $(mktemp -d)'

View file

@ -51,8 +51,15 @@ if [ -n "$force_color_prompt" ]; then
fi fi
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 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 else
PS1='\u@\h:\w\$ ' PS1='\u@\h:\w\$ '
fi fi
@ -116,7 +123,14 @@ export EDITOR="nvim"
export VISUAL="nvim" export VISUAL="nvim"
# Fix DIR # 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 ### ### END OF SOME LOCAL VARIABBLES ###
@ -128,5 +142,5 @@ fi
# Autostart X at login # Autostart X at login
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec sx exec startx
fi fi

View file

@ -30,7 +30,7 @@ font pango:monospace 10
floating_modifier $mod floating_modifier $mod
# Use tabbed layout mode # Use tabbed layout mode
# workspace_layout tabbed workspace_layout tabbed
# Disable mouse focus # Disable mouse focus
focus_follows_mouse no focus_follows_mouse no
@ -45,6 +45,8 @@ exec parcellite
exec feh --bg-fill '/home/sechacklabs/Pictures/SHL/Nuevos Logos/shl-fin.png' exec feh --bg-fill '/home/sechacklabs/Pictures/SHL/Nuevos Logos/shl-fin.png'
# Keyring daemon # Keyring daemon
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 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 # Battery icon, used to get notifications in battery critical level and more
# exec cbatticon # exec cbatticon
@ -65,18 +67,17 @@ bindsym $mod+x exec gajim
bindsym $mod+F3 exec pcmanfm bindsym $mod+F3 exec pcmanfm
# Firefox # Firefox
# bindsym $mod+f exec firefox bindsym $mod+f exec firefox
bindsym $mod+f exec firefox-nightly
# SMPlayer # SMPlayer
bindsym $mod+p exec vlc bindsym $mod+p exec vlc
# Signal Desktop
# bindsym $mod+s exec "signal-desktop --disable-gpu"
# Discord # Discord
bindsym $mod+d exec discord bindsym $mod+d exec discord
# Signal
bindsym $mod+s exec "slack"
# Take screenshots # Take screenshots
bindsym Print exec "maim -s --format=png | xclip -selection clipboard -t image/png" 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" 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 # Monitor brigthness
bindcode 233 exec xbacklight -inc 5 bindcode 171 exec "brightnessctl set 5%+"
bindcode 232 exec xbacklight -dec 5 bindcode 173 exec "brightnessctl set 5%-"
# Volume control # 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%" 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 { bar {
status_command i3status status_command i3status
} }

View file

@ -8,9 +8,6 @@
general { general {
colors = true colors = true
#color_good = "#b8bb26"
#color_bad = "#fb4934"
#color_degraded = "#fabd2f"
separator = "" separator = ""
output_format = "i3bar" output_format = "i3bar"
interval = 2 interval = 2
@ -19,7 +16,7 @@ general {
order += "path_exists VPN" order += "path_exists VPN"
order += "disk /" order += "disk /"
order += "disk /home" order += "disk /home"
#order += "disk /mnt/data" order += "cpu_usage"
order += "load" order += "load"
order += "memory" order += "memory"
order += "cpu_temperature 0" order += "cpu_temperature 0"
@ -46,9 +43,9 @@ disk "/home" {
path_exists VPN { path_exists VPN {
# path exists when a VPN tunnel is active # path exists when a VPN tunnel is active
format = "🖧 OK" format = "🖧 ON"
format_down = "🖧 X" format_down = "🖧 OFF"
path = "/proc/sys/net/ipv4/conf/tun0" path = "/proc/sys/net/ipv4/conf/tun0"
} }
battery all { battery all {
@ -65,17 +62,22 @@ load {
} }
memory { memory {
format = "⚖️ %used | %available" format = "⚖️ %used"
threshold_degraded = "1G" threshold_degraded = "1G"
format_degraded = "⛔ < %available" format_degraded = "⛔ < %available"
} }
cpu_temperature 0 { cpu_temperature 0 {
format = "🌡️ %degrees °C" format = "🌡️ %degrees °C"
max_threshold = 80
format_above_threshold = "🔥 %degrees °C" 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 { tztime local {
format = "🌎 %a %d %H:%M" format = "🌎 %a %d %H:%M"
} }
cpu_usage {
format = "💻 %usage"
}

View file

@ -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

View file

@ -0,0 +1,10 @@
[Unit]
Description=Check for new subdomains.
[Timer]
OnBootSec=5min
OnUnitActiveSec=10min
Unit=findomain.service
[Install]
WantedBy=timers.target