Skip to content

Instantly share code, notes, and snippets.

(function (root, factory) {
if(typeof define === "function" && define.amd) {
define(["postal"], factory);
} else if(typeof module === "object" && module.exports) {
module.exports = factory(require("postal"));
} else {
root.myModule = factory(root.postal);
}
}(this, function(postal) {
var sub;
@n3ksus
n3ksus / menu.lst
Created July 25, 2016 07:30 — forked from poppen/menu.lst
menu.lst of grub4dos for booting iso images from usb drive
# This is a sample menu.lst file. You should make some changes to it.
# The old install method of booting via the stage-files has been removed.
# Please install GRLDR boot strap code to MBR with the bootlace.com
# utility under DOS/Win9x or Linux.
color white/light-blue yellow/cyan light-gray/magenta white/light-red
title Acronis True Image Home
find --set-root /atih.iso
map /atih.iso (0xff) || map --mem /atih.iso (0xff)
@n3ksus
n3ksus / concat_binary.erl
Created August 22, 2017 08:12 — forked from halfelf/concat_binary.erl
Concatenate binaries in erlang
% concat, binary
B1= <<1,2>>.
B2= <<3,4>>.
B3= <<B1/binary, B2/binary>>.
% <<1,2,3,4>>
@n3ksus
n3ksus / DeviceUuidFactory.java
Created February 19, 2019 07:42 — forked from lenamuit/DeviceUuidFactory.java
Generate UUID for Android
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
public class DeviceUuidFactory {
@n3ksus
n3ksus / DeviceUuidFactory.java
Created February 19, 2019 08:57 — forked from beilly/DeviceUuidFactory.java
实现在设备上更通用的获取设备唯一标识
package com.benli.app.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
@n3ksus
n3ksus / linux-http-tcp.md
Created September 3, 2019 04:00 — forked from v5tech/linux-http-tcp.md
linux下查看http 并发和 tcp连接数

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@n3ksus
n3ksus / ffmpeg-nonfree-build-centos-7.sh
Created February 28, 2020 04:52 — forked from silverkorn/ffmpeg-nonfree-build-centos-7.sh
An automated script to build FFmpeg non-free on RHEL/CentOS with as much features as possible. (Including mediainfo for debugging)
# TODO: Verify to link statically some dependencies usually not available in a default instllation of RHEL/CentOS (ex.: libxcb)
###################
## Configuration ##
###################
FFMPEG_CPU_COUNT=$(nproc)
FFMPEG_ENABLE="--enable-gpl --enable-version3 --enable-nonfree --enable-runtime-cpudetect --enable-gray --enable-openssl --enable-libfreetype"
FFMPEG_HOME=/usr/local/src/ffmpeg
@n3ksus
n3ksus / install-ffmpeg-amazon-linux.sh
Created February 28, 2020 06:05 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@n3ksus
n3ksus / compile-ffmpeg-nvenc.sh
Created March 1, 2020 09:06
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@n3ksus
n3ksus / hookalloverloads.js
Created May 17, 2020 05:32 — forked from FrankSpierings/hookalloverloads.js
Hook all overloads - Java/Android - Frida
function getGenericInterceptor(className, func, parameters) {
args = []
for (i = 0; i < parameters.length; i++) {
args.push('arg_' + i)
}
var script = "result = this.__FUNCNAME__(__SEPARATED_ARG_NAMES__);\nlogmessage = '__CLASSNAME__.__FUNCNAME__(' + __SEPARATED_ARG_NAMES__ + ') => ' + result;\nconsole.log(logmessage);\nreturn result;"
script = script.replace(/__FUNCNAME__/g, func);
script = script.replace(/__SEPARATED_ARG_NAMES__/g, args.join(', '));
script = script.replace(/__CLASSNAME__/g, className);