Skip to content

Instantly share code, notes, and snippets.

a=$(ls -lq *jpg *gif *png|wc -l);while [ $a -lt 392 ];do for i in {0..392};do (b=$(curl https://www.vgcats.com/comics/?strip_id=$i|grep -roEe 'src=\"images/.*jpg' -Ee 'src=\"images/.*gif' -Ee 'src=\"images/.*png' -|cut -c 13-);if ls $b;then echo existing;else wget --retry-on-http-error --no-clobber https://www.vgcats.com/comics/images/$b;fi)&done;find . -type f -not -name '*jpg' -not -name '*gif' -not -name '*png' -print0|xargs -0 rm --;a=$(ls -lq *jpg *gif *png|wc -l);done
@nottux
nottux / this_is_not_a_scritpt.sh
Created May 30, 2020 23:37
This took ~two days but worth it
#To list files& folders that going to be removed:
eval "echo !($((a=/home/utku;find /home/utku3 /mnt/old_drive/utku2 -type l -ls|sed 's/-> /\t/g;s/\\303\\266/ö/g;s/\\303\\274/ü/g'|cut -f 2|grep $a/;echo -e $a/took\\n$a/Belgeler\\n$a/İndirilenler)|sed s/$(echo $(pwd)|sed 's/\//\\\//g')//g|sed 's/\//\t/g'|cut -f 2|tr \\n '|'))"
#To remove said folders:
eval "sudo rm -rfv !($((a=/home/utku;find /home/utku3 /mnt/old_drive/utku2 -type l -ls|sed 's/-> /\t/g;s/\\303\\266/ö/g;s/\\303\\274/ü/g'|cut -f 2|grep $a/;echo -e $a/took\\n$a/Belgeler\\n$a/İndirilenler)|sed s/$(echo $(pwd)|sed 's/\//\\\//g')//g|sed 's/\//\t/g'|cut -f 2|tr \\n '|'))"
#Lists again but changed for utku2
eval "echo !($((a=/home/utku2;find /home/utku3 /mnt/old_drive/utku -type l -ls|sed 's/-> /\t/g;s/\\303\\266/ö/g;s/\\303\\274/ü/g'|cut -f 2|grep $a/;echo -e $a/took\\n$a/Belgeler\\n$a/İndirilenler)|sed s/$(echo $(pwd)|sed 's/\//\\\//g')//g|sed 's/\//\t/g'|cut -f 2|tr \\n '|'))"
#You get the idea
#I have got bit more into sed with this and learnt a l
sudo su -c '((while avahi-daemon -c;do avahi-daemon -k;done)&(while pgrep akonadi;do pkill -ce akonadi;done)&(while pgrep kio;do pkill -ce kio;done);echo done individuals)&for i in whoopsie cups packagekit apache2 openvpn apport gdm3 php7.4-fpm snapd winbind nmbd smbd teamviewerd ;do (while systemctl is-active $i;do systemctl stop $i;done)&done;wait $!;echo done all'
sudo su -c 'pkill -ce cdemu'
@nottux
nottux / af.sh
Last active January 16, 2021 19:12
a script to auto connect my android phone
#!/bin/bash
a=android-aa8b17a6b252b32
b=/tmp/casper_ip.txt
c="192.168.43.1"
d=$(route -n | awk '{if($4=="UG")print $2}')
e=$(ip -o -f inet addr show | grep -Po "/[[:digit:]]{1,2}(?=.*scope\sglobal)")
if [ "$1" = "$z" ]
then :
else if [ -f "$b" ]
@nottux
nottux / vpn.sh
Last active January 18, 2021 12:41
namespaced vpn but easy
#!/bin/bash
pipe=/tmp/outpipe_vpn
case "$1" in
firefox|web|fox) app="firefox --private-window";;
haku|neko|nero|hakuneko|hakunero) app="/usr/lib/hakuneko-desktop/hakuneko";;
shell|sh) app="echo openning shell";;
*) app="firefox --private-window";;
esac
@nottux
nottux / huion_rotate.sh
Last active March 14, 2021 16:47
Rotate drawing tablet 180 degrees on linux while using multiple or single monitor(s)
bash -c 'name="HUION Huion Tablet Pen (0)";a=($(xinput list-props "$name"| grep -Po "Coordinate\sTransformation\sMatrix(.*?):\s\K.*"|tr -d ","));a[2]=$(echo ${a[0]}+${a[2]}|bc);a[5]=$(echo ${a[4]}+${a[5]}|bc);a[0]=$(echo ${a[0]}*-1|bc);a[4]=$(echo ${a[4]}*-1|bc);xinput set-prop "$name" "Coordinate Transformation Matrix" ${a[*]}'
@nottux
nottux / dire_situation.txt
Created March 6, 2021 23:39
important command since "gamer moment" caused hdd to rip
sudo dd if=/dev/sdb conv=sync,noerror bs=64K | xz -zevvkT0 -09 -c > /dev/shm/test.xz
The required JAVA program is given below,
import java.util.Arrays;
import java.util.Scanner;
class Ideone {
// Finding the index of largest element
public static int indexOfLargestElement(double[] array){
double maxValue = array[0];
int maxIndex = 0;
@nottux
nottux / 2.java
Last active April 13, 2021 15:46
package labtest;
import java.util.Arrays;
import java.util.Scanner;
public class labtest {
public static void reverse(double[] array){
//reading array from reverse
for (int i = array.length-1; i >= 0; i--) {
System.out.print(array[i] + " ");
https://android.stackexchange.com/a/158069/286740
```
adb shell
su
setprop persist.adb.tcp.port 5555
```
https://qr.ae/pGIZAH
fastboot oem unlock
fastboot oem off-mode-charge 0