Skip to content

Instantly share code, notes, and snippets.

View hazdzz's full-sized avatar

Chieh Chang hazdzz

  • National Central University
  • Taiwan
View GitHub Profile
@stackia
stackia / homebrew.mxcl.aria2.plist
Last active October 13, 2023 04:50
aria2c daemon start at boot. Put this file into /Library/LaunchDaemons, them 'chmod 600' and 'chown root'. Remember to fill placeholders below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.aria2</string>
@goxofy
goxofy / Karabiner_Private_For_Filco_Minila.xml
Last active April 23, 2024 09:19
Karabiner 备份 For Filco Minila
<?xml version="1.0"?>
<root>
<!-- 设备定义 -->
<devicevendordef>
<vendorname>FILCO</vendorname>
<vendorid>0x0a5c</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MINILA_KEYBOARD</productname>
@nuomi1
nuomi1 / PrintBootCampESDInfo.swift
Last active May 16, 2024 01:17
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// PrintBootCampESDInfo.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation
@dibmartins
dibmartins / install-chrome-ubuntu
Created February 8, 2017 16:12
install-chrome-ubuntu
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@mgeeky
mgeeky / Malicious-CHM-Guide.md
Created February 6, 2018 13:52
CheatSheet describing how to create malicious CHM file by hand (another approach is to use Nishang's Out-Chm scriptlet).

Procedure for generating Malicious CHM file

  • Step 0: Download and install Microsoft HTML Help Workshop and Documentation
  • Step 1: Obtain a valid CHM file and unpack it using 7-zip
  • Step 2: Find an entry-point HTML file within "docs" directory and insert the following code into it's <body> section:
<OBJECT id=x classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=1 height=1>
@stefanonardo
stefanonardo / early_stopping.py
Last active February 28, 2024 19:21
Early Stopping PyTorch
# MIT License
#
# Copyright (c) 2018 Stefano Nardo https://gist.github.com/stefanonardo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@pbamotra
pbamotra / sigsoftmax.py
Created April 10, 2019 04:08
Pytorch implementation of sigsoftmax - https://arxiv.org/pdf/1805.10829.pdf
def logsigsoftmax(logits):
"""
Computes sigsoftmax from the paper - https://arxiv.org/pdf/1805.10829.pdf
"""
max_values = torch.max(logits, 1, keepdim = True)[0]
exp_logits_sigmoided = torch.exp(logits - max_values) * torch.sigmoid(logits)
sum_exp_logits_sigmoided = exp_logits_sigmoided.sum(1, keepdim = True)
log_probs = logits - max_values + torch.log(torch.sigmoid(logits)) - torch.log(sum_exp_logits_sigmoided)
return log_probs
@muink
muink / install-ota-update-rooted-android-device-guide.md
Last active November 5, 2023 15:09
在rooted設備上使用Magisk進行OTA更新[保留root和TWRP]

在rooted設備上使用Magisk進行OTA更新[保留root和TWRP]

您已收到OTA推送更新,但由於您的Android設備已root而無法安裝它?嗯,這是rooted的Android設備的已知缺點。 在本指南中,您將學習如何使用Magisk在rooted的Android設備上安裝OTA更新。 通過使用本指南中提供的方法,您還可以在安裝OTA更新後保留rootTWRP。在進一步了解之前,讓我們快速看一下OTA更新是什麼以及它如何運作。

什麼是OTA更新?

OTA更新又名空中升級(Over-the-Air Update),是一種通過無線方式接收和安裝Android設備軟件更新的方法。