Showing posts with label quick fix. Show all posts
Showing posts with label quick fix. Show all posts

2020/12/05

Script to reconnect wan via rc.inet1

My router is a Linux PC with 2 lan boards, one for local lan and the other directly connected to the ISP router (configured as bridge). Each time my ISP disconnects me for whatever reason I had to either reboot the computer or keep running rc.inet1 restart until the connection is made.

So, even if it doesn't happen often, at one point I got bored of it and decided to write an script to force the reconnection as soon as possible:

 #!/bin/bash
while true ; do
   clear
   ./rc.inet1 restart
   ping google.com -c 1
   if [ $? == 0 ]; then
      exit
   fi;
   sleep 30
done

 

2018/07/19

script to kill a specific process by name

This one was made specifically for VLC since the stupid program sometimes hangs and there is no way to close it by normal means (Quit command, etc)

#!/bin/bash
$(echo -n kill -9 ; ps -A |grep vlc |grep -o "^ [0-9]*")
what it does is to create a command line on the fly by extracting vlc process id and then execute it.

2018/06/16

stylish for stackexchange

removes annoying cookies usage notice (which I have them blocked with CookieMonster anyway):

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("stackexchange.com") {
#js-gdpr-consent-banner
  { display: none !important; }
}

2018/06/06

"unable to un/install on windows" error

a quick list of things to check:
MSIEXEC /UNREGISTER
MSIEXEC /REGSERVER

or

HKEY_LOCAL_MACHINE \Software\Microsoft\Windows\CurrentVersion\Installer\InProgress   

or

HKEY_LOCAL_MACHINE \System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations


HKEY_LOCAL_MACHINE \Software\Microsoft\Windows\CurrentVersion\Installer

2017/09/05

UnHook EXE

This can be useful when a trojan or virus replaces registry entries for executable files with a custom one.

[Version]
Signature="$Chicago$"

[DefaultInstall]
AddReg=UnhookRegKey

[UnhookRegKey]
HKLM, Software\CLASSES\batfile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\comfile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\exefile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\piffile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\regfile\shell\open\command,,,"regedit.exe ""%1"""
HKLM, Software\CLASSES\scrfile\shell\open\command,,,"""%1"" %*"
HKCU, Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,0x00000020,0