Skip to content

Instantly share code, notes, and snippets.

@damonYuan
damonYuan / Activate Office 2019 for macOS VoL.md
Last active March 2, 2022 04:58 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@damonYuan
damonYuan / tcp-proxy.sh
Created July 14, 2021 07:14
using netcat to build a simple tcp proxy
#!/bin/sh -e
# https://notes.tweakblogs.net/blog/7955/using-netcat-to-build-a-simple-tcp-proxy-in-linux.html
if [ $# != 3 ]
then
echo "usage: $0 <src-port> <dst-host> <dst-port>"
exit 0
fi
TMP=`mktemp -d`
@damonYuan
damonYuan / new_script
Created February 22, 2020 06:40
[new_script to generate a shell template](http://linuxcommand.org/lc3_new_script.php)
#!/bin/bash
# ---------------------------------------------------------------------------
# new_script - Bash shell script template generator
# Copyright 2012, William Shotts <bshotts@users.sourceforge.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@damonYuan
damonYuan / double-fork-daemon.py
Created February 9, 2020 15:14 — forked from TheWaWaR/double-fork-daemon.py
UNIX double-fork magic to let process be daemon
def spawnDaemon(func):
# do the UNIX double-fork magic, see Stevens' "Advanced
# Programming in the UNIX Environment" for details (ISBN 0201563177)
try:
pid = os.fork()
if pid > 0:
# parent process, return and keep running
return
except OSError, e:
print >>sys.stderr, "fork #1 failed: %d (%s)" % (e.errno, e.strerror)
@damonYuan
damonYuan / delete_git_submodule.md
Created February 2, 2020 11:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
```
| No ENTRYPOINT | ENTRYPOINT entry | ENTRYPOINT ["entry"] |
------------+-----------------+------------------------------ ---+-----------------------|
No CMD | <error> | /bin/sh -c entry | entry |
CMD cmd | /bin/sh -c cmd | /bin/sh -c entry /bin/sh -c cmd | entry /bin/sh -c cmd |
CMD ["cmd"] | cmd | /bin/sh -c entry cmd | entry cmd |
------------------------------------------------------------------------------------------
```
@damonYuan
damonYuan / memory_leak_detection.sh
Created January 21, 2019 14:07
memory leakage detection
# ps -A | grep ${PROCESS_NAME} | awk '{print $1}'
get_pid()
{
process_name=$1
text=`ps -A | grep $process_name`
# 去掉开头的空格
text=`echo $text | sed -e 's/^[ \t]*//g'`
#没有这个进程
if [ "${text}" = "" ] ; then
@damonYuan
damonYuan / Jenkinsfile.groovy
Created December 14, 2018 08:51 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
#
# Set the build number to the current git commit count.
# If we're using the Dev scheme, then we'll suffix the build
# number with the current branch name, to make collisions
# far less likely across feature branches.
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/
#
git=`sh /etc/profile; which git`
appBuild=`"$git" rev-list --all |wc -l`
if [ $CONFIGURATION = "Debug" ]; then
@damonYuan
damonYuan / gist:c97739bf906dca4622278b169759ec9a
Created October 22, 2018 05:00
Android check lib dependency
./gradlew -q dependencies app:dependencies --configuration debugCompileClasspath