Skip to content

Instantly share code, notes, and snippets.

@yhnu
yhnu / luaalloc
Created September 25, 2018 08:25
slua 自定义luaalloc分析内存
static void *my_alloc(void *ud, void *ptr, size_t osize, size_t nsize) {
(void)ud; (void)osize; /* not used */
if (nsize == 0) {
if (ptr != NULL) {
fprintf(stderr, "lua free %u\n", osize);
}
free(ptr);
return NULL;
}
else
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerName www.example.com
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerName www.example.com
@yhnu
yhnu / log
Created November 7, 2017 13:36
ls
sudo apt-get install apache2
ping google.com
ls
sudo apt-get install php5
sudo apt-get install php7
sudo apt-get install php
sudo apt-get install mysql-server
sudo apt-get install php-mysql
sudo apt-get install composer
@yhnu
yhnu / log
Created November 7, 2017 10:29
ls
sudo apt-get install apache2
ping google.com
ls
sudo apt-get install php5
sudo apt-get install php7
sudo apt-get install php
sudo apt-get install mysql-server
sudo apt-get install php-mysql
sudo apt-get install composer
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
So you'd like to manage your iOS devices by command line?
You can use libimobiledevice tools for that.
Easy on Linux. Let's see how it is on Mac OS X.
You'll need to:
1. install Xcode
2. start Xcode and agree to it's license
3. install Xcode command line tools (Start Xcode, Go to Preferences -> Downloads tab)
4. install homebrew by this command (sudo password will be prompted)
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
@yhnu
yhnu / recompile-and-run.sh
Created August 28, 2017 09:51 — forked from PuKoren/recompile-and-run.sh
Recompile APK + Sign with apktool
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK
# and decompile apk using it
# apktool d -rf my-app.apk
# then generate a key for sign in:
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
rm signed-app.apk
apktool b -f -d com.myapp
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk
@yhnu
yhnu / gist.sh
Created August 8, 2017 17:36 — forked from anonymous/gist.sh
sudo apt-get install rubygems
gem install gist