Skip to content

Instantly share code, notes, and snippets.

View toshi75's full-sized avatar
💭
alive

toshi75

💭
alive
  • Japan
  • 13:37 (UTC +09:00)
View GitHub Profile
@toshi75
toshi75 / Kill gnome trackers
Last active October 29, 2020 23:50
Kill gnome trackers
killthem (){
#https://www.linuxuprising.com/2019/07/how-to-completely-disable-tracker.html
# No need to be "SU"
systemctl --user mask tracker-store.service \
tracker-miner-fs.service \
tracker-miner-rss.service \
tracker-extract.service \
tracker-miner-apps.service \
tracker-writeback.service
tracker reset --hard
@toshi75
toshi75 / show progress without scrolling
Created July 6, 2020 17:46
show progress without scrolling
demo (){
NO=0
ALL=30
HIT=0
while true ;do
[[ "$((RANDOM%5))" -eq 0 ]] && let HIT++
let NO++
#####################################
echo -ne " $NO / $ALL / HIT: $HIT\r"
@toshi75
toshi75 / set-vm.sh
Last active July 22, 2020 14:55
create VM script for virtualbox
#!/bin/bash
VMDIR="$HOME/ssd120"
ISODIR="$HOME/ex11/linux_iso"
FOLDER_TO_BE_SHARED="$HOME/dotfiles" # Set as readonly, automount.
#########################################
cd "$HOME"
[[ ! -d "$VMDIR" ]] && VMDIR="$HOME"
Set-Item function:global:prompt {$host.UI.Write("Yellow", $host.UI.RawUI.BackgroundColor, "PS ");$host.UI.WriteLine("Green", $host.UI.RawUI.BackgroundColor,(Get-Location).Path); ">+XX(@>|" }
@toshi75
toshi75 / detect MIME type
Created April 7, 2020 01:20
detect MIME type
xdg-mime query filetype /path/to/file
@toshi75
toshi75 / Bookmarklet Copy Source to clipboard.
Created April 6, 2020 00:24
Bookmarklet Copy Source to clipboard.
javascript:(function(){var o=new XMLSerializer();e = document.createElement('textarea');e.textContent = (o.serializeToString(document.documentElement));document.body.appendChild(e);e.select();document.execCommand('copy');e.remove();})();
//#############################################################################
javascript:(
function(){
var o=new XMLSerializer();
e = document.createElement('textarea');
e.textContent = (o.serializeToString(document.documentElement));
document.body.appendChild(e);
e.select();
@toshi75
toshi75 / wget web crawler
Created March 30, 2020 23:36
wget web crawler
#!/bin/bash
cd "$(cd "$(dirname "$0")";pwd)"
ALIVE=crawler_PID_$$.runnig
echo $$ >"$ALIVE"
wget \
--mirror \
--recursive \
--continue \
--execute robots=off \
--user-agent='Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2725.0 Safari/537.36' \
@toshi75
toshi75 / remove html tag
Created March 26, 2020 18:29
remove html tag
sed -e 's|<[^>]*>||g'
@toshi75
toshi75 / call function from xargs
Created March 20, 2020 23:01
call function from xargs
function FUNC (){
scripts..
}
export -f FUNC
stdout | xargs -t -I{} bash -c "FUNC {}"
^ ^ quate here
@toshi75
toshi75 / nkf:encord decode web strings
Created March 11, 2020 16:38
nkf: encode decode web strings like %20..
Emcode
stdout | nkf -WwMQ | tr = % |stdout
Decode
stdout | nkf --url-input |stdout