Year: 2020
-
Excel return text right of last occurrence of string
=TRIM(RIGHT(SUBSTITUTE(A1;” “;REPT(” “;LEN(A1)));LEN(A1)))
-
Pihole CORS problems
Fix: edit /var/www/html/admin/scripts/pi-hole/php/auth.php add your host names to AUTHORIZED_HOSTNAMES array
-
Move cygwin to different disk, including services
Stop all services, log out other users, in process explorer, add command line column, stop all in old path In cygwin, go to /cygdrive, cp -vR c/cygwin* d/ mount -m > /usr/bin/mountCommands.bat # not sure if we really need this in explorer, rename c:/cygwin to OLD , log off all users if it fails, use…
-
Convert m4b to mp3 on Centos/Fedora using ffmpeg
for m4b in *.m4b; do ffmpeg -i $m4b -acodec libmp3lame -ar 22050 ${m4b}.mp3; done
-
AWK print longest line in file
awk ‘{ if (length($0) > max) {max = length($0); maxline = $0} } END { print maxline }’ YOURFILE
-
Windows “File is open in another program” (lsof in windows)
First get handle: https://docs.microsoft.com/en-us/sysinternals/downloads/handle Run handle once without searching for anything, to accept license. Run in a CMD AS ADMIN: handle64.exe > output.txt . Find the file you want. Then scroll up to header to see what proc is taking it.
-
Fix bricked firmware update jabra (evolve)
Get firmware from support site. Then update via “C:\Program Files (x86)\Jabra\SDKFirmwareUpdater\JabraFwUpdater.exe”
-
Tmux save all output (history) to file
bind-key P command-prompt -p ‘save history to filename:’ -I ‘~/tmux.history’ ‘capture-pane -S -32768 ; save-buffer %1 ; delete-buffer’ Add above in tmux.conf. Then do Prefix+Shift+P
-
Upgrade dumb shell to interactive shell (tty)
python -c ‘import pty; pty.spawn(“/bin/bash”)’ yay python
-
Excel return last line of multi line cell
=TRIM(RIGHT(SUBSTITUTE(B5,CHAR(10),REPT(” “;200));200)) Especially useful for project trackers. Add a LEFT(XXX;10) for returning dates.
-
Keeping a (GitHub) fork up to date with upstream master
1. Clone your fork: 2. Add remote from original repository in your forked repository: 3. Updating your fork from original repo to keep up with their changes: thanks
-
MySQL / MariaDB DB and user creation
create user ‘nextcloud’@’localhost’ identified by ‘xxx’; create database nextcloud; grant all privileges on nextcloud.* to ‘nextcloud’@’localhost’ identified by ‘xxx’; FLUSH PRIVILEGES;
-
AutoRecon over proxychains
Since we have no icmp/ping over proxychains, we have to change syntax a bit ~/svn/proxychains-ng/proxychains4 -f ~/proxychains.conf ~/svn/AutoRecon/autorecon.py –nmap ‘\-sT \-Pn’ 10.1.1.{1,224,235,246,248}