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 / MSO15.11.2Patch
Created July 16, 2015 13:44
MSO15.11.2Patch
#!/bin/bash
echo "Patching Microsoft Office Outlook..."
sudo perl -i.bak -pe 's|\x00\x0F\xA3\xCA\x72\x02\x31\xC0|\x00\x0F\xA3\xCA\x72\x02\x90\x90|' /Applications/Microsoft\ Outlook.app/Contents/Frameworks/MicrosoftSetupUI.framework/Versions/Current/MicrosoftSetupUI
sudo codesign -f -s - /Applications/Microsoft\ Outlook.app/Contents/Frameworks/MicrosoftSetupUI.framework
echo "Patching Microsoft Office Word..."
sudo perl -i.bak -pe 's|\x00\x0F\xA3\xCA\x72\x02\x31\xC0|\x00\x0F\xA3\xCA\x72\x02\x90\x90|' /Applications/Microsoft\ Word.app/Contents/Frameworks/MicrosoftSetupUI.framework/Versions/Current/MicrosoftSetupUI
sudo codesign -f -s - /Applications/Microsoft\ Word.app/Contents/Frameworks/MicrosoftSetupUI.framework
@Leask
Leask / PurgeParallelsAccess.sh
Created September 5, 2016 08:27
Find and remove existing installations of Parallels Access
#!/usr/bin/env bash
#
# Find and remove existing installations of Parallels Access
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
RootCheck () {
if [ $(id -u) != "0" ]
then
sudo -p "This script requires administrative privileges. Please enter your password: " "$0" "$@"
@Leask
Leask / remove_office.sh
Created April 25, 2015 20:12
How to completely remove Office for Mac 2011?!
#!/bin/sh
# Original from: https://www.v2ex.com/t/174943#reply12
# more informations: https://support.microsoft.com/en-us/kb/2398768
osascript -e 'tell application "Microsoft Database Daemon" to quit'
rm -R '/Applications/Microsoft Communicator.app/'
rm -R '/Applications/Microsoft Messenger.app/'
rm -R '/Applications/Microsoft Office 2011/'
rm -R '/Applications/Remote Desktop Connection.app/'
@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