Skip to content

Instantly share code, notes, and snippets.

View Leask's full-sized avatar
🏠
Working from home

Sixia "Leask" Huang Leask

🏠
Working from home
View GitHub Profile
@Leask
Leask / erlang-elixir-on-amazon-linux-2.sh
Last active June 1, 2022 15:42 — forked from techgaun/erlang-elixir-on-amazon-linux.md
Running elixir 1.12.1 on amazon linux 2
#!/bin/bash
# run this script with root privileges
# pre-install
yum install ncurses-devel openssl-devel gcc-c++ automake cmake fop unixODBC-devel libssh2-devel -y
yum groupinstall "Development Tools" -y
# More Dependencies Needed: *openjdk-devel, wxGTK-devel
# https://github.com/asdf-vm/asdf-erlang/issues/83
# https://gist.github.com/tharun-allu/dd7d123a1ee264e03d3656dd0727f362
@Leask
Leask / smartctl.log
Created June 15, 2021 02:39
Smartctl INFORMATION
root@Foundation:/etc# smartctl -x /dev/sdb
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.19.0-16-amd64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba 3.5" DT01ACA... Desktop HDD
Device Model: TOSHIBA DT01ACA200
Serial Number: 99JHDDEGS
LU WWN Device Id: 5 000039 fdbc7001e
Add. Product Id: DELL(tm)
.text
msg: .ascii "Fuck CCP!\n"
.global _start
_start:
mov $1, %rax
mov $1, %rdi
mov $msg, %rsi
mov $13, %rdx
syscall
mov $60, %rax
@Leask
Leask / TogglERMINAL.applescript
Created May 14, 2021 02:44
TogglERMINAL.workflow // Show or Hide Terminal.app
set strTime to date string of (current date) & " " & time string of (current date)
tell application "System Events"
set curApp to name of first application process whose frontmost is true
if curApp is "Terminal" then
set visible of application process "Terminal" to false
display notification strTime with title "Flora" subtitle "🎮 Terminal is hidden." sound name "Submarine"
else
tell application "Terminal" to activate
display notification strTime with title "Flora" subtitle "💻 Terminal is shown." sound name "Blow"
@Leask
Leask / sysinfo.txt
Created July 9, 2020 17:10
Dell G5 Tower System Information
00:00.0 Host bridge: Intel Corporation 8th Gen Core 8-core Desktop Processor Host Bridge/DRAM Registers [Coffee Lake S] (rev 0d)
Subsystem: Dell 8th Gen Core 8-core Desktop Processor Host Bridge/DRAM Registers [Coffee Lake S]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
Latency: 0
Capabilities: [e0] Vendor Specific Information: Len=10 <?>
Kernel driver in use: skl_uncore
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 0d) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
'use strict';
// CREATE TABLE `test`(
// `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
// `content` TEXT NOT NULL,
// PRIMARY KEY(`id`)
// ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
const util = require('util');
const mysql = require('mysql2').createPool({
@Leask
Leask / now.sh
Created January 12, 2020 22:17
The heavy lifting is the splash component...
# The heavy lifting is the splash component that shows this:
# https://askubuntu.com/questions/1020692/terminal-splash-screen-with-weather-calendar-time-sysinfo
# Weather report: Edmonton March 2018 ┌────────────────────────────┐
# Su Mo Tu We Th Fr Sa │ ┏━┓╺┓ ┏━┓┏━┓ ┏━┓┏┳┓ │
# \ / Sunny 1 2 3 │ ┃┃┃ ┃ ╹┏━┛┗━┫ ┣━┛┃┃┃ │
# .-. -23--14 °C 4 5 6 7 8 9 10 │ ┗━┛╺┻╸╹┗━╸┗━┛ ╹ ╹ ╹ │
# ― ( ) ― ↘ 22 km/h 11 12 13 14 15 16 17 └────────────────────────────┘
# `-’ 14 km 18 19 20 21 22 23 24
# / \ 0.9 mm 25 26 27 28 29 30 31
@Leask
Leask / dbxclear.sh
Created January 10, 2020 22:35
Clean Dropbox conflicted files.
#!/bin/sh
# Flora Dropbox clear by LeaskH.com
dbcMatcher="*(*'s conflicted copy 20*-*-*)*"
num=`find ~ -name "$dbcMatcher" | wc -l`
if [ $num -gt 0 ]; then
echo "Dropbox conflicted file(s):\n"
find ~ -name "$dbcMatcher"
echo "\nTotal: $num item(s), do you want to clear now? (y/n)"
read answer
@Leask
Leask / brew-up.sh
Last active January 10, 2020 22:34
Updating brew packages.
# Flora Up by LeaskH.com
up() {
echo 'Updating brew packages...'
brew update
brew upgrade --all
brew cleanup
echo ':) Done'
}
@Leask
Leask / black-box.sh
Last active January 10, 2020 22:34
BlackBox is a simple toolkit to backup my GoPro videos and my Blackberry phone records.
#!/bin/sh
# Flora BlackBox Utilities by LeaskH.com
# BlackBox is a simple toolkit to backup my GoPro videos and my Blackberry phone records.
initBlackBox() {
if [ -e "$basePath" ]; then
logFile="$basePath$logFile"
echoWithLog "<<<<<<< Flora BlackBox >>>>>>>\n"
else
logFile="/var/log$logFile"