first commit
This commit is contained in:
1
.local/bin/backup-mc
Executable file
1
.local/bin/backup-mc
Executable file
@ -0,0 +1 @@
|
||||
sudo mkdir -p /mnt/backup/mcserver/$(/bin/date +%Y-%m-%d); sudo chown yorune:yorune -R /mnt/backup/mcserver/$(/bin/date +%Y-%m-%d); sudo cp -rv /home/yorune/mcserver/* /mnt/backup/mcserver/$(/bin/date +%Y-%m-%d)
|
8
.local/bin/bin-cp
Executable file
8
.local/bin/bin-cp
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
chmod +x *
|
||||
chown -R yorune: *
|
||||
sudo cp -pr * /bin/
|
||||
#sudo cp /etc/bash.bashrc ../configs
|
||||
#cp /home/yorune/Arch/configs/zshrc /home/yorune/.zshrc
|
||||
#cp /home/yorune/Arch/configs/vimrc /home/yorune/.vimrc
|
||||
echo DONE!!
|
15
.local/bin/cleaner
Executable file
15
.local/bin/cleaner
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
sudo rm -rf /var/tmp/portage/*
|
||||
sudo rm -rf /var/tmp/binpkgs/*
|
||||
sudo rm -rf /var/tmp/genkernel/*
|
||||
sudo rm -rf /tmp/*
|
||||
sudo rm -rf /var/cache/genkernel/*
|
||||
sudo emerge -a --depclean
|
||||
sudo emerge -a @preserved-rebuild
|
||||
sudo eclean -C -q packages
|
||||
sudo eclean -C -q -d -t1w distfiles
|
||||
sudo revdep-rebuild
|
||||
sudo perl-cleaner --all
|
||||
sudo etc-update
|
||||
sudo env-update
|
||||
source /etc/profile
|
5
.local/bin/cleanertmp
Executable file
5
.local/bin/cleanertmp
Executable file
@ -0,0 +1,5 @@
|
||||
sudo rm -rf /var/tmp/portage/*
|
||||
sudo rm -rf /var/tmp/binpkgs/*
|
||||
sudo rm -rf /var/tmp/genkernel/*
|
||||
sudo rm -rf /tmp/*
|
||||
sudo rm -rf /var/cache/genkernel/*
|
4
.local/bin/cmus-shell
Executable file
4
.local/bin/cmus-shell
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
if ! screen -r -D cmus >/dev/null ; then
|
||||
screen -S cmus /usr/bin/cmus "$@"
|
||||
fi
|
59
.local/bin/dmenumount
Executable file
59
.local/bin/dmenumount
Executable file
@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
# Gives a dmenu prompt to mount unmounted drives.
|
||||
# If they're in /etc/fstab, they'll be mounted automatically.
|
||||
# Otherwise, you'll be prompted to give a mountpoint from already existsing directories.
|
||||
# If you input a novel directory, it will prompt you to create that directory.
|
||||
|
||||
getmount() { \
|
||||
[ -z "$chosen" ] && exit 1
|
||||
mp="$(find $1 | dmenu -i -p "Type in mount point.")"
|
||||
[ "$mp" = "" ] && exit 1
|
||||
if [ ! -d "$mp" ]; then
|
||||
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
|
||||
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
|
||||
fi
|
||||
}
|
||||
|
||||
mountusb() { \
|
||||
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
|
||||
sudo -A mount "$chosen" && notify-send "💻 USB mounting" "$chosen mounted." && exit 0
|
||||
alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \( -path *%s -prune \) \ \n",$3}')
|
||||
getmount "/mnt /media -maxdepth 5 -type d $alreadymounted"
|
||||
partitiontype="$(lsblk -no "fstype" "$chosen")"
|
||||
case "$partitiontype" in
|
||||
"vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;;
|
||||
*) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" 741 "$mp";;
|
||||
esac
|
||||
notify-send "💻 USB mounting" "$chosen mounted to $mp."
|
||||
}
|
||||
|
||||
mountandroid() { \
|
||||
chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1)
|
||||
getmount "/media -maxdepth 3 -type d"
|
||||
sudo simple-mtpfs --device "$chosen" "$mp"
|
||||
notify-send "🤖 Android Mounting" "Android device mounted to $mp."
|
||||
}
|
||||
|
||||
asktype() { \
|
||||
case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in
|
||||
USB) mountusb ;;
|
||||
Android) mountandroid ;;
|
||||
esac
|
||||
}
|
||||
|
||||
anddrives=$(simple-mtpfs -l 2>/dev/null)
|
||||
usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}')"
|
||||
|
||||
if [ -z "$usbdrives" ]; then
|
||||
[ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit
|
||||
echo "Android device(s) detected."
|
||||
mountandroid
|
||||
else
|
||||
if [ -z "$anddrives" ]; then
|
||||
echo "USB drive(s) detected."
|
||||
mountusb
|
||||
else
|
||||
echo "Mountable USB drive(s) and Android device(s) detected."
|
||||
asktype
|
||||
fi
|
||||
fi
|
41
.local/bin/dmenuumount
Executable file
41
.local/bin/dmenuumount
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# A dmenu prompt to unmount drives.
|
||||
# Provides you with mounted partitions, select one to unmount.
|
||||
# Drives mounted at /, /boot and /home will not be options to unmount.
|
||||
|
||||
unmountusb() {
|
||||
[ -z "$drives" ] && exit
|
||||
chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}')
|
||||
[ -z "$chosen" ] && exit
|
||||
sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted."
|
||||
}
|
||||
|
||||
unmountandroid() { \
|
||||
chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
|
||||
[ -z "$chosen" ] && exit
|
||||
sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted."
|
||||
}
|
||||
|
||||
asktype() { \
|
||||
case "$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" in
|
||||
USB) unmountusb ;;
|
||||
Android) unmountandroid ;;
|
||||
esac
|
||||
}
|
||||
|
||||
drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
|
||||
|
||||
if ! grep simple-mtpfs /etc/mtab; then
|
||||
[ -z "$drives" ] && echo "No drives to unmount." && exit
|
||||
echo "Unmountable USB drive detected."
|
||||
unmountusb
|
||||
else
|
||||
if [ -z "$drives" ]
|
||||
then
|
||||
echo "Unmountable Android device detected."
|
||||
unmountandroid
|
||||
else
|
||||
echo "Unmountable USB drive(s) and Android device(s) detected."
|
||||
asktype
|
||||
fi
|
||||
fi
|
18
.local/bin/dmenuunicode
Executable file
18
.local/bin/dmenuunicode
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Give dmenu list of all unicode characters to copy.
|
||||
# Shows the selected character in dunst if running.
|
||||
|
||||
# Must have xclip installed to even show menu.
|
||||
xclip -h >/dev/null || exit
|
||||
|
||||
chosen=$(grep -v "#" ~/dwm/emoji | dmenu -i -l 20 -fn Monospace-18)
|
||||
|
||||
[ "$chosen" != "" ] || exit
|
||||
|
||||
c=$(echo "$chosen" | sed "s/ .*//")
|
||||
echo "$c" | tr -d '\n' | xclip -selection clipboard
|
||||
notify-send "'$c' copied to clipboard." &
|
||||
|
||||
s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}')
|
||||
echo "$s" | tr -d '\n' | xclip
|
||||
notify-send "'$s' copied to primary." &
|
2
.local/bin/eix-repos-sync
Executable file
2
.local/bin/eix-repos-sync
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
for i in /usr/repos/*/.git; do ( echo $i; cd $i/..; sudo git pull; ); done
|
8
.local/bin/f2py
Executable file
8
.local/bin/f2py
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/python3.6
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from numpy.f2py.f2py2e import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
8
.local/bin/f2py3
Executable file
8
.local/bin/f2py3
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/python3.6
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from numpy.f2py.f2py2e import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
8
.local/bin/f2py3.6
Executable file
8
.local/bin/f2py3.6
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/python3.6
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from numpy.f2py.f2py2e import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
3
.local/bin/geoip
Executable file
3
.local/bin/geoip
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -s ipinfo.io/$1
|
15
.local/bin/getforecast
Executable file
15
.local/bin/getforecast
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Updates weather forecast
|
||||
|
||||
FILE="$HOME/.config/.weatherreport.tmp"
|
||||
FILER="$HOME/.config/weatherreport"
|
||||
|
||||
curl -s --max-time 10 "wttr.in/$location" > $FILE
|
||||
|
||||
if [ -s "$FILE" ]
|
||||
then
|
||||
mv $FILE $FILER
|
||||
# notify-send " Weather" "The weather forecast has been updated."
|
||||
else
|
||||
rm $FILE
|
||||
fi
|
11
.local/bin/git-init-folder
Executable file
11
.local/bin/git-init-folder
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir $1
|
||||
cd $1
|
||||
git init
|
||||
touch README.md
|
||||
git add README.md
|
||||
git commit -m "first commit"
|
||||
curl -u 'linux923344' https://api.github.com/user/repos -d '{"name":"'$1'"}'
|
||||
git remote add origin git@github.com:linux923344/$1.git
|
||||
git push -u origin master
|
11
.local/bin/hosts-update
Executable file
11
.local/bin/hosts-update
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
rm -rf /tmp/steven /tmp/luke /tmp/hosts
|
||||
wget -O /tmp/steven https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts
|
||||
|
||||
wget -O /tmp/luke https://raw.githubusercontent.com/LukeSmithxyz/etc/master/ips
|
||||
|
||||
cat /tmp/luke >> /tmp/steven
|
||||
|
||||
cat /tmp/steven | sort | uniq -d | sed '/^#/d' >> /tmp/hosts
|
||||
|
||||
sudo mv /tmp/hosts /etc/hosts
|
26
.local/bin/mailsync
Executable file
26
.local/bin/mailsync
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env sh
|
||||
# Sync mail and give notification if there is new mail.
|
||||
|
||||
# Checks for internet connection and set notification script.
|
||||
ping -q -c 1 1.1.1.1 > /dev/null || exit
|
||||
command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotify-send\` should be installed for pop-up mail notifications with this script."
|
||||
|
||||
export DISPLAY=:0.0
|
||||
# IKONKA SYNC ##echo " 🔃" > /tmp/imapsyncicon_$USER
|
||||
pkill -RTMIN+12 i3blocks
|
||||
|
||||
# Run mbsync. You can feed this script different settings.
|
||||
mbsync -a
|
||||
|
||||
# IKONKA SYNC #rm -f /tmp/imapsyncicon_$USER
|
||||
pkill -RTMIN+12 i3blocks
|
||||
|
||||
RESULT=$(echo "$(du -a ~/.mailbox/*/inbox/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null)")
|
||||
#if [ -z $RESULT ]; then
|
||||
# echo ""
|
||||
#else
|
||||
# notify-send "mutt-wizard" "📬 new mail(s)"
|
||||
#fi
|
||||
|
||||
#Create a touch file that indicates the time of the last run of mailsync
|
||||
touch "$HOME/.mutt/.mailsynclastrun"
|
1
.local/bin/minecraft-launcher
Executable file
1
.local/bin/minecraft-launcher
Executable file
@ -0,0 +1 @@
|
||||
java -Xmx1024M -Xms1024M -jar /home/yorune/Linux/apps/TLauncher-MCL.jar
|
10
.local/bin/mouse-set
Executable file
10
.local/bin/mouse-set
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
choices="Off\nCycle"
|
||||
chosen=$(echo -e "$choices" | dmenu -i)
|
||||
|
||||
mouse=$(sudo ratbag-command list | awk '{print $1}' | sed 's/://')
|
||||
|
||||
case "$chosen" in
|
||||
Off) sudo ratbag-command led 0 set mode off $mouse ;;
|
||||
Cycle) sudo ratbag-command led 0 set mode cycle $mouse && sudo ratbag-command led 0 set rate 25000 $mouse ;;
|
||||
esac
|
2
.local/bin/night
Executable file
2
.local/bin/night
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
redshift -l 52.2327:18.3036 -t 6500:3200&
|
22
.local/bin/obsh
Executable file
22
.local/bin/obsh
Executable file
@ -0,0 +1,22 @@
|
||||
#! /bin/bash
|
||||
broadcast=$(ip a | awk '$1 == "inet" && $4 !~ /^127/ { print $4"/24" }' | uniq)
|
||||
|
||||
RED='\033[0;31m'
|
||||
GRAY='\033[0;37m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
clear
|
||||
printf "${GRAY}Executing nmap on the subnets: ${RED}\n$broadcast\n"
|
||||
candidates=$(
|
||||
for brdip in ${broadcast}; do
|
||||
nmap -sP $brdip | awk '$2 == "scan" { print $5 }'
|
||||
done)
|
||||
printf "${GRAY}\nFound the following candidates: ${GREEN}\n$candidates\n"
|
||||
for ip in ${candidates}; do
|
||||
printf "${GRAY}\nProbing $ip...\n${NC}"
|
||||
ssh -q root@$ip
|
||||
done
|
||||
clear
|
||||
echo "Nothing found"
|
||||
|
5
.local/bin/rasp
Executable file
5
.local/bin/rasp
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
sudo chown yorune: /mnt/rasp
|
||||
sshfs root@192.168.0.222:/mnt/ /mnt/rasp/
|
||||
sleep 10
|
||||
cd /mnt/rasp
|
12
.local/bin/screen-switcher
Executable file
12
.local/bin/screen-switcher
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
choices="Left\nRight\nDuplicated\nHDMI\nMonitor\n"
|
||||
|
||||
chosen=$(echo -e "$choices" | dmenu -i)
|
||||
|
||||
case "$chosen" in
|
||||
Monitor) mons -o ;;
|
||||
Duplicated) mons -d ;;
|
||||
Left) mons -e left ;;
|
||||
Right) mons -e right ;;
|
||||
HDMI) mons -s
|
||||
esac
|
7
.local/bin/screenshot
Executable file
7
.local/bin/screenshot
Executable file
@ -0,0 +1,7 @@
|
||||
FILE="/tmp/`date +%Y%m%d-%H.%M.%S.png`"
|
||||
NAME=$(date +%s | sha256sum | base64 | head -c 20 ; echo)
|
||||
|
||||
gnome-screenshot -f "$FILE"
|
||||
rsync -avz --delete $FILE -e "ssh -p 2223" root@209.250.255.224:/var/www/yorune.pl/u/$NAME.png &&
|
||||
|
||||
echo -e "https://yorune.pl/u/$NAME.png" | xclip -selection clipboard && notify-send "Screenshot has been updated"
|
7
.local/bin/screenshot-area
Executable file
7
.local/bin/screenshot-area
Executable file
@ -0,0 +1,7 @@
|
||||
FILE="/tmp/`date +%Y%m%d-%H.%M.%S.png`"
|
||||
NAME=$(date +%s | sha256sum | base64 | head -c 20 ; echo)
|
||||
|
||||
gnome-screenshot --area -f "$FILE"
|
||||
rsync -avz --delete $FILE -e "ssh -p 2223" root@209.250.255.224:/var/www/yorune.pl/u/$NAME.png &&
|
||||
|
||||
echo -e "https://yorune.pl/u/$NAME.png" | xclip -selection clipboard && notify-send "Screenshot has been updated"
|
7
.local/bin/set-wallpaper
Executable file
7
.local/bin/set-wallpaper
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
cp $1 ~/.wall.jpg
|
||||
#feh --bg-scale /home/yorune/.wall.jpg
|
||||
feh --bg-fill /home/yorune/.wall.jpg
|
||||
#wal -i $1 -o wal-set
|
||||
notify-send "Wallpaper changed"
|
13
.local/bin/shut-sup-rest
Executable file
13
.local/bin/shut-sup-rest
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
choices="Lock\nSuspend\nReboot\nShutdown"
|
||||
|
||||
chosen=$(echo -e "$choices" | dmenu -i)
|
||||
|
||||
case "$chosen" in
|
||||
Lock) slock ;;
|
||||
Suspend) sudo pm-suspend && slock ;;
|
||||
#Suspend) sudo systemctl suspend && slock ;;
|
||||
#Suspend) sudo systemctl suspend && locki3 ;;
|
||||
Reboot) sudo reboot ;;
|
||||
Shutdown) sudo shutdown -h now ;;
|
||||
esac
|
1944
.local/bin/speedtest-cli
Executable file
1944
.local/bin/speedtest-cli
Executable file
File diff suppressed because it is too large
Load Diff
10
.local/bin/ssh-permissions
Executable file
10
.local/bin/ssh-permissions
Executable file
@ -0,0 +1,10 @@
|
||||
chmod 700 ~/.ssh
|
||||
chmod 644 ~/.ssh/authorized_keys
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/config
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
chmod 644 ~/.ssh/id_rsa.pub
|
||||
chmod 600 ~/.ssh/github_rsa
|
||||
chmod 644 ~/.ssh/github_rsa.pub
|
||||
chmod 600 ~/.ssh/mozilla_rsa
|
||||
chmod 644 ~/.ssh/mozilla_rsa.pub
|
2
.local/bin/stream-twitch
Executable file
2
.local/bin/stream-twitch
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
nohup streamlink -p mpv https://www.twitch.tv/$1 best > /dev/null 2>&1 &
|
2
.local/bin/stream-youtube
Executable file
2
.local/bin/stream-youtube
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
nohup streamlink -p mpv $1 best > /dev/null 2>&1 &
|
15
.local/bin/suspend-at-time
Executable file
15
.local/bin/suspend-at-time
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
#./suspend-at-time 0:00
|
||||
|
||||
RUNAT="$1"
|
||||
|
||||
while [ 1 ]
|
||||
do
|
||||
DATE=`/bin/date +%H:%M`
|
||||
if [ $DATE. = $RUNAT. ]
|
||||
then
|
||||
sudo systemctl suspend
|
||||
echo ""DONE" at "$(date)""
|
||||
pkill suspend-at-time
|
||||
fi
|
||||
done
|
3
.local/bin/temp
Executable file
3
.local/bin/temp
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo -e "CPU: $(sensors | awk '/Core 0/ {print $3}'| egrep --color=no -o '[0-9]+\.' | sed 's/\.//')"; echo -e "GPU: $(sudo nvidia-smi -q -d temperature | grep --color=no -i "GPU Current" |egrep --color=no -o '[0-9]*')"
|
1
.local/bin/term-wmi
Executable file
1
.local/bin/term-wmi
Executable file
@ -0,0 +1 @@
|
||||
rdesktop -u "\LABS\s434812" -g 90% term.wmi.amu.edu.pl
|
2
.local/bin/twitch
Executable file
2
.local/bin/twitch
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
nohup streamlink -p mpv https://www.twitch.tv/$1 best > /dev/null 2>&1 &
|
2
.local/bin/update
Executable file
2
.local/bin/update
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sudo eix-repos-sync; sudo emerge-webrsync; sudo emerge --sync; sudo eix-sync -a; sudo eix-update; sudo emaint sync -a; sudo emerge -auDN @world
|
108
.local/bin/update-kernel
Executable file
108
.local/bin/update-kernel
Executable file
@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
BACKUP="/home/yorune/Linux/portage"
|
||||
LOG_FILE="/tmp/update-kernel.log"
|
||||
TMP_KERNEL="/tmp/kernel-config-`uname -r`"
|
||||
DEFAULT_KERNEL="/usr/src/linux/.config"
|
||||
|
||||
function starting() {
|
||||
echo -e "\e[93m----------------------COMPILING------------------------------\e[0m"
|
||||
sudo cp -rv $DEFAULT_KERNEL $TMP_KERNEL
|
||||
cp -r $TMP_KERNEL $BACKUP
|
||||
cp -r /etc/portage/* $BACKUP
|
||||
qlist -I | sort | uniq | tr '\n' ' ' > $BACKUP/list-of-programs-"$(date +"%d-%m-%Y")"
|
||||
}
|
||||
|
||||
function selection() {
|
||||
echo -e "\e[93m----------------------SELECTION-----------------------------\e[0m"
|
||||
sudo eselect kernel list
|
||||
echo
|
||||
echo
|
||||
read -p "New kernel is: " KERVER
|
||||
echo
|
||||
echo -e "Your kernel now is \e[91m$(uname -sr)\e[0m"
|
||||
echo -e "Your selected kernel is \e[91m"$KERVER"\e[0m"
|
||||
sudo eselect kernel set $KERVER
|
||||
sudo eselect kernel list | grep "*"
|
||||
echo
|
||||
}
|
||||
|
||||
function compilation() {
|
||||
read -p "Do you want to accept and compile (Y/N): " agreed
|
||||
echo
|
||||
if [ "$agreed" == "y" ] || [ "$agreed" == "Y" ]
|
||||
then
|
||||
echo -e "\e[91m----------------------\e[5mSTARTING\e[0m\e[91m------------------------------\e[0m" && sleep 10
|
||||
$NOW > /tmp/compiling-starting
|
||||
NEW_KERNEL="/tmp/new-kernel-config"
|
||||
sudo cp -r $TMP_KERNEL $DEFAULT_KERNEL
|
||||
cd /usr/src/linux; sudo make menuconfig; sleep 2; sudo cp -r $DEFAULT_KERNEL $NEW_KERNEL
|
||||
sudo genkernel all --makeopts=-j$(nproc --all) --kernel-config=$NEW_KERNEL --callback="emerge nvidia-drivers::gentoo"
|
||||
elif [ "$agreed" == "N" ] || [ "$agreed" == "n" ]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
function ending() {
|
||||
echo
|
||||
echo
|
||||
echo -e "\e[93m----------------------CHECKING-----------------------------\e[0m"
|
||||
checking
|
||||
echo
|
||||
echo
|
||||
echo -e "\e[93m----------------------REMEMBER-----------------------------\e[0m"
|
||||
echo "You can remove:"
|
||||
echo "* /lib/modules/OLD_KERNEL"
|
||||
echo "* /boot/initramfs-genkernel-OLD_KERNEL"
|
||||
echo "* /boot/vmlinuz-OLD_KERNEL"
|
||||
echo "* /boot/System.map-OLD_KERNEL"
|
||||
echo "* /boot/initramfs-OLD_KERNEL"
|
||||
echo "* /usr/src/linux-OLD_KERNEL"
|
||||
echo
|
||||
echo -e "AFTER EVERYTHING YOU MUST WRITE COMMAND \e[91m"sudo grub-mkconfig -o /boot/grub/grub.cfg"\e[0m"
|
||||
}
|
||||
|
||||
function checking() {
|
||||
KERNEL=`eselect kernel list | awk '{print $2}' | egrep -o '[0-9]+.[0-9]+.[0-9]+' | tail -n1`
|
||||
|
||||
INITRANFS="initramfs-$KERNEL-gentoo-x86_64.img"
|
||||
SYSTEMMAP="System.map-$KERNEL-gentoo-x86_64"
|
||||
VMLINUZ="vmlinuz-$KERNEL-gentoo-x86_64"
|
||||
|
||||
ifchecking $INITRANFS
|
||||
ifchecking $SYSTEMMAP
|
||||
ifchecking $VMLINUZ
|
||||
}
|
||||
|
||||
function ifchecking () {
|
||||
FILE=/boot/$1
|
||||
if test -f "$FILE"; then
|
||||
echo "$FILE exist in the /boot folder ;)"
|
||||
else
|
||||
echo "$FILE NOT exist in the /boot folder ;)"
|
||||
fi
|
||||
}
|
||||
|
||||
function main() {
|
||||
clear
|
||||
|
||||
BEGIN=$(date +"%s")
|
||||
|
||||
starting
|
||||
selection
|
||||
compilation
|
||||
|
||||
echo -e "\e[31mI am leaving! Thank You!\e[0m" && sleep 3
|
||||
|
||||
TERMIN=$(date +"%s")
|
||||
DIFFTLPS=$(($TERMIN-$BEGIN))
|
||||
|
||||
echo -e "\e[93m------------------TIME COMPILATION-------------------------\e[0m"
|
||||
echo -e "\e[93m$(($DIFFTLPS / 60)) minutes and $(($DIFFTLPS % 60)) seconds \e[0m elapsed for Script Execution." && sleep 3
|
||||
ending
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
main
|
54
.local/bin/welcomer
Executable file
54
.local/bin/welcomer
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
MEMTOTAL=`awk '$3=="kB"{$2=$2/1024**2;$3="GB";} 1' /proc/meminfo | column -t | grep "MemTotal" | awk '{print $2}'`
|
||||
MEMFREE=`awk '$3=="kB"{$2=$2/1024**2;$3="GB";} 1' /proc/meminfo | column -t | grep "MemAvailable" | awk '{print $2}'`
|
||||
NETE=`ip a | awk {'print $2'} | grep -i en | sed 's/://g'`
|
||||
NETW=`ip a | awk {'print $2'} | grep -i wl | sed 's/://g'`
|
||||
BACKUP_SDA8=`df -h | grep -i sda8 | awk '{print $5", " $2 " (Total), " $3" (Usage)"}'`
|
||||
BACKUP_EL=`df -h | grep /run/media/jaqu3/ELEMENTS | awk '{print $5", " $2 " (Total), " $3" (Usage)"}'`
|
||||
BACKUP_EV=`df -h | grep /run/media/jaqu3/BACKUP_EVERYTHING | awk '{print $5", " $2 " (Total), " $3" (Usage)"}'`
|
||||
|
||||
|
||||
if [ -z "$NETW" ]; then
|
||||
NETD=$NETE
|
||||
else
|
||||
NETD=$NETW
|
||||
fi
|
||||
|
||||
if [ -z "$BACKUP_SDA8" ]; then
|
||||
BACKUPSDA8=`echo NOT MOUNTED`
|
||||
else
|
||||
BACKUPSDA8=$BACKUP_SDA8
|
||||
fi
|
||||
|
||||
if [ -z "$BACKUP_EL" ]; then
|
||||
BACKUPEL=`echo NOT MOUNTED`
|
||||
else
|
||||
BACKUPEL=$BACKUP_EL
|
||||
fi
|
||||
|
||||
if [ -z "$BACKUP_EV" ]; then
|
||||
BACKUPEV=`echo NOT MOUNTED`
|
||||
else
|
||||
BACKUPEV=$BACKUP_EV
|
||||
fi
|
||||
|
||||
echo -e "
|
||||
\033[0;35m+++++++++++++++++++: \033[0;37mInfo\033[0;35m :+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
+
|
||||
+ \033[0;37mHostname \033[0;35m= \033[1;32m `hostname`
|
||||
\033[0;35m+ \033[0;37mAddress \033[0;35m= \033[1;32m `/sbin/ip addr show $NETD | grep "inet " | awk '{print $2}' | cut -d'/' -f1`
|
||||
\033[0;35m+ \033[0;37mKernel \033[0;35m= \033[1;32m `uname -r`
|
||||
\033[0;35m+ \033[0;37mUptime \033[0;35m= \033[1;32m`uptime | sed 's/.*up ([^,]*), .*/1/'`
|
||||
\033[0;35m+ \033[0;37mMemory \033[0;35m= \033[1;32m $MEMTOTAL GB (free $MEMFREE GB)\033[0;35m
|
||||
\033[0;35m+ \033[0;37mUsername \033[0;35m= \033[1;32m `whoami`\033[0;35m
|
||||
+
|
||||
\033[0;35m++++++++++++++++++: \033[0;37mStorage\033[0;35m :+++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
+
|
||||
+ \033[0;37m/ \033[0;35m= \033[1;32m `df -h / | sed '1,1d' | awk '{print $5\", \"$2\" (Total), \"$3\" (Usage)\"}'`\033[0;35m
|
||||
+ \033[0;37mSDA8 \033[0;35m= \033[1;32m $BACKUPSDA8 \033[0;35m
|
||||
+ \033[0;37mELEMENTS \033[0;35m= \033[1;32m $BACKUPEL \033[0;35m
|
||||
+ \033[0;37mBACKUP_EVERYTHING \033[0;35m= \033[1;32m $BACKUPEV \033[0;35m
|
||||
+
|
||||
\033[0;35m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \033[0m"
|
||||
echo ""
|
33
.local/bin/welcomer-serwer
Executable file
33
.local/bin/welcomer-serwer
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copy this file to /bin/welcomer and change permisson +x
|
||||
# sudo bash -c $'echo "/bin/welcomer" >> /etc/profile.d/mymotd.sh && chmod +x /etc/profile.d/mymotd.sh'
|
||||
|
||||
|
||||
MEMTOTAL=`awk '$3=="kB"{$2=$2/1024**2;$3="GB";} 1' /proc/meminfo | column -t | grep "MemTotal" | awk '{print $2}'`
|
||||
MEMFREE=`awk '$3=="kB"{$2=$2/1024**2;$3="GB";} 1' /proc/meminfo | column -t | grep "MemAvailable" | awk '{print $2}'`
|
||||
NETE=`ip a | awk {'print $2'} | grep -i en | sed 's/://g'`
|
||||
NETW=`ip a | awk {'print $2'} | grep -i wl | sed 's/://g'`
|
||||
|
||||
if [ -z "$NETW" ]; then
|
||||
NETD=$NETE
|
||||
else
|
||||
NETD=$NETW
|
||||
fi
|
||||
|
||||
echo -e "
|
||||
\033[0;35m+++++++++++++++++++: \033[0;37mInfo\033[0;35m :+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
+
|
||||
+ \033[0;37mHostname \033[0;35m= \033[1;32m `hostname`
|
||||
\033[0;35m+ \033[0;37mAddress \033[0;35m= \033[1;32m `/sbin/ip addr show $NETD | grep "inet " | awk '{print $2}' | cut -d'/' -f1`
|
||||
\033[0;35m+ \033[0;37mKernel \033[0;35m= \033[1;32m `uname -r`
|
||||
\033[0;35m+ \033[0;37mUptime \033[0;35m= \033[1;32m`uptime | sed 's/.*up ([^,]*), .*/1/'`
|
||||
\033[0;35m+ \033[0;37mMemory \033[0;35m= \033[1;32m $MEMTOTAL GB (free $MEMFREE GB)\033[0;35m
|
||||
\033[0;35m+ \033[0;37mUsername \033[0;35m= \033[1;32m `whoami`\033[0;35m
|
||||
+
|
||||
\033[0;35m++++++++++++++++++: \033[0;37mStorage\033[0;35m :+++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
+
|
||||
+ \033[0;37m/ \033[0;35m= \033[1;32m `df -h / | sed '1,1d' | awk '{print $5\", \"$2\" (Total), \"$3\" (Usage)\"}'`\033[0;35m
|
||||
+
|
||||
\033[0;35m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \033[0m"
|
||||
echo ""
|
8
.local/bin/wheel
Executable file
8
.local/bin/wheel
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/python3.6
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from wheel.cli import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
5
.local/bin/wylaczoff
Executable file
5
.local/bin/wylaczoff
Executable file
@ -0,0 +1,5 @@
|
||||
xset b off
|
||||
xset s off && xset -dpms
|
||||
set bell-style none
|
||||
#/usr/bin/amixer -c 0 sset "Auto-Mute Mode" Disabled
|
||||
|
1
.local/bin/yatqa
Executable file
1
.local/bin/yatqa
Executable file
@ -0,0 +1 @@
|
||||
wine "C:/Program Files (x86)/YaTQA/yatqa.exe"
|
2
.local/bin/yt-mp3
Executable file
2
.local/bin/yt-mp3
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
youtube-dl --extract-audio --audio-format mp3 $1
|
2
.local/bin/yt-video
Executable file
2
.local/bin/yt-video
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
youtube-dl $1
|
Reference in New Issue
Block a user