Compare commits
7 Commits
90d2373ee2
...
113591c7a9
Author | SHA1 | Date | |
---|---|---|---|
113591c7a9 | |||
d1c9548128 | |||
220db6ec7e | |||
a790ca3fc8 | |||
a43f4aea0a | |||
8b23fc6990 | |||
ba7347ade1 |
10
ddg
Executable file
10
ddg
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||||
|
|
||||||
|
if [ "$#" -eq 0 ] ; then
|
||||||
|
echo "WARNING! All your communication will bypass VPN and firewall!"
|
||||||
|
su no-fw -c 'lynx http://detectportal.firefox.com'
|
||||||
|
else
|
||||||
|
lynx "https://duckduckgo.com/?q=$(join_by '+' $@ )&t=ffab"
|
||||||
|
fi
|
4
emails
4
emails
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# We setup xauthority file to display stuff
|
# We setup xauthority file to display stuff
|
||||||
xauthority="$(cat ~/.Xauthority)"
|
auth="$(xauth extract - "$DISPLAY" | base64)"
|
||||||
exec sudo -u emails sh -c "echo \"$xauthority\" > ~/.Xauthority && . ~/.bashrc && exec aerc"
|
exec sudo -u emails sh -c "echo -n '$auth' | base64 -d > ~/.Xauthority && . ~/.bashrc && cd ~/attachements && exec aerc"
|
||||||
|
36
gw.sh
Executable file
36
gw.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
. driglibash-base
|
||||||
|
|
||||||
|
if [ "$#" -ne 2 ] ; then
|
||||||
|
yell "Missing 2 parameters"
|
||||||
|
die "Usage: $0 <local_iface> <net_iface>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
root_or_die
|
||||||
|
|
||||||
|
local_iface="$1"
|
||||||
|
net_iface="$2"
|
||||||
|
|
||||||
|
run sysctl net.ipv4.ip_forward=1
|
||||||
|
clean "sysctl net.ipv4.ip_forward=1"
|
||||||
|
|
||||||
|
run nmcli device set "$local_iface" managed no
|
||||||
|
clean "nmcli device set "$local_iface" managed yes"
|
||||||
|
|
||||||
|
run ip a add 192.168.238.254/24 dev "$local_iface"
|
||||||
|
clean "ip a del 192.168.238.254/24 dev $local_iface"
|
||||||
|
|
||||||
|
# For dhcp offers
|
||||||
|
run iptables -A OUTPUT -d 255.255.255.255/32 -j ACCEPT
|
||||||
|
|
||||||
|
run iptables -A OUTPUT -d 192.168.238.0/24 -j ACCEPT
|
||||||
|
run iptables -A INPUT -s 192.168.238.0/24 -j ACCEPT
|
||||||
|
run iptables -A INPUT -s 255.255.255.255 -j ACCEPT
|
||||||
|
run iptables -A INPUT -i "$local_iface" -j ACCEPT
|
||||||
|
|
||||||
|
run iptables -t nat -A POSTROUTING -o "$net_iface" -j MASQUERADE
|
||||||
|
run iptables -A FORWARD -i $net_iface -o $local_iface -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
run iptables -A FORWARD -i $local_iface -o $net_iface -j ACCEPT
|
||||||
|
run dnsmasq --dhcp-range=192.168.238.100,192.168.238.199,10m -d --server=9.9.9.9
|
||||||
|
|
||||||
|
clean
|
25
lscolors
Executable file
25
lscolors
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
local fgc bgc vals seq0
|
||||||
|
|
||||||
|
printf "Color escapes are %s\n" '\e[${value};...;${value}m'
|
||||||
|
printf "Values 30..37 are \e[33mforeground colors\e[m\n"
|
||||||
|
printf "Values 40..47 are \e[43mbackground colors\e[m\n"
|
||||||
|
printf "Value 1 gives a \e[1mbold-faced look\e[m\n\n"
|
||||||
|
|
||||||
|
# foreground colors
|
||||||
|
for fgc in {30..37}; do
|
||||||
|
# background colors
|
||||||
|
for bgc in {40..47}; do
|
||||||
|
fgc=${fgc#37} # white
|
||||||
|
bgc=${bgc#40} # black
|
||||||
|
|
||||||
|
vals="${fgc:+$fgc;}${bgc}"
|
||||||
|
vals=${vals%%;}
|
||||||
|
|
||||||
|
seq0="${vals:+\e[${vals}m}"
|
||||||
|
printf " %-9s" "${seq0:-(default)}"
|
||||||
|
printf " ${seq0}TEXT\e[m"
|
||||||
|
printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m"
|
||||||
|
done
|
||||||
|
echo; echo
|
||||||
|
done
|
12
startsync
Executable file
12
startsync
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
nextcloud &
|
||||||
|
feedreader &
|
||||||
|
#jami-gnome &
|
||||||
|
offlineimap
|
||||||
|
vdirsyncer sync
|
||||||
|
birthday_reminder
|
||||||
|
while true ; do
|
||||||
|
offlineimap -q
|
||||||
|
#mpop -a
|
||||||
|
#notmuch new
|
||||||
|
sleep 30
|
||||||
|
done
|
30
switch-vpn
30
switch-vpn
@ -1,9 +1,27 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ -n "$(nmcli connection show rezine_vpn37_udp | grep activated)" ] ; then
|
function say () {
|
||||||
nmcli connection down rezine_vpn37_udp
|
notify-send 'VPN UDP' "$1"
|
||||||
else
|
}
|
||||||
nmcli connection up rezine_vpn37_udp
|
|
||||||
|
action="$1"
|
||||||
|
if [ -z "$1" ] ; then
|
||||||
|
if [ -n "$(nmcli connection show rezine_vpn37_udp | grep activated)" ] ; then
|
||||||
|
action=start
|
||||||
|
else
|
||||||
|
action=stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nmcli connection show rezine_vpn37_udp | grep 'VPN connected' &>/dev/null
|
if [ "$action" = "start" ] ; then
|
||||||
[ "$?" -eq 0 ] && notify-send 'VPN UDP connecté' || notify-send 'VPN UDP stoppé'
|
nmcli connection up rezine_vpn37_udp
|
||||||
|
sleep 1
|
||||||
|
nmcli connection show rezine_vpn37_udp | grep 'VPN connected' &>/dev/null
|
||||||
|
[ "$?" -eq 0 ] && say 'Connecté :)' || say 'Non connecté :('
|
||||||
|
elif [ "$action" = "stop" ] ; then
|
||||||
|
nmcli connection down rezine_vpn37_udp
|
||||||
|
sleep 1
|
||||||
|
nmcli connection show rezine_vpn37_udp | grep 'VPN connected' &>/dev/null
|
||||||
|
[ "$?" -eq 0 ] && say 'Toujours connecté :(' || say 'stoppé :)'
|
||||||
|
else
|
||||||
|
say 'Bad script usage. Action not known'
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user