Skip to content

Instantly share code, notes, and snippets.

View toshi75's full-sized avatar
💭
alive

toshi75

💭
alive
  • Japan
  • 02:30 (UTC +09:00)
View GitHub Profile
curl -qkL "${URL}" |jar -xvf /dev/stdin # <= zip
|tar Jx # <= tar.xz
|unzstd - |tar x # <= tar.zst
@toshi75
toshi75 / $0 and $BASH_SOURCE
Created August 11, 2023 13:26
$0 and $BASH_SOURCE #shell
func_test (){
# echo file name of "test.scr"
cat << '____SCR' > test.scr
echo $0
echo $BASH_SOURCE
echo ${BASH_SOURCE:-$0}
____SCR
chmod 777 ./test.scr
local N=1
echo '## ./test.scr #################'
@toshi75
toshi75 / Display UTF-8 chr. by bash command
Created August 3, 2023 00:16
Display UTF-8 chr. by bash command #shell
U+1F449 =>
echo -e "\U1F449"
echo "$(echo -e "\U1F449")"
@toshi75
toshi75 / Unpack "eval(function(p,a,c,k,e,d){...", On bash with nodejs.
Created May 29, 2023 13:46
Unpack "eval(function(p,a,c,k,e,d){...", On bash with nodejs. #shell #JavaScript
Replace "eval" => "console.log"
And, Write to /path/to/file.js
"eval(function(p,a,c,k,e,d){..."
=> "console.log(function(p,a,c,k,e,d){..."
Then, run it.
node /path/to/file.js >What_you_want.txt
@toshi75
toshi75 / Bookmarklet
Created October 4, 2022 09:06
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();})();
//Copy url to clipboard
javascript:(function(){e = document.createElement('textarea');e.textContent = document.URL;document.body.appendChild(e);e.select();document.execCommand('copy');e.remove();})();
//Duplicate tab
javascript:window.open(location.href)
@toshi75
toshi75 / No Scroll
Created July 15, 2022 00:14
No Scroll
N=1
for i in {1..1000} ;do
echo -ne "Time: $N s\r"
sleep 1s
let N++
done
@toshi75
toshi75 / for each
Created July 12, 2022 04:42
for each #shell
foreach (){
for i in {1st,2nd,3rd,4th,5th,.................} ;do
/do/something "$i"
done
ARRAY=(
1st
2nd
3rd
4th
@toshi75
toshi75 / Editor color settings
Created July 4, 2022 17:13
Editor color settings
gedit: ~/.local/share/gedit/styles
pluma: ~/.config/pluma/styles
xed : ~/.local/share/gtksourceview-3.0/styles
@toshi75
toshi75 / VBoxSysInfo.sh
Created May 2, 2022 16:16
detect dist.
#!/bin/sh
# @file
#
# Installer (Unix-like)
# Information about the host system/Linux distribution
#
# Copyright (C) 2006-2020 Oracle Corporation
#
@toshi75
toshi75 / tput装飾一覧
Created April 3, 2022 01:11
tput装飾一覧
tput装飾一覧
https://qiita.com/onokatio/items/5d282b72ac5565ae4569
色番号=>色
0=>黒
1=>赤
2=>緑
3=>黄色
4=>青
5=>マゼンタ
6=>シアン