Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Seven askdaddy

🎯
Focusing
View GitHub Profile
@askdaddy
askdaddy / clean_boot.md
Last active Mar 16, 2020
清理/boot目录
View clean_boot.md
@bigtan
bigtan / compile.sh
Last active Jul 21, 2022
shadowsocks-libev static build
View compile.sh
apt-get update && apt-get install build-essential automake autoconf libtool git clang -y && export CC=clang
ver=2.16.3
wget --no-check-certificate https://tls.mbed.org/download/mbedtls-$ver-gpl.tgz
tar zxf mbedtls-$ver-gpl.tgz
cd mbedtls-$ver
sed -i "s/DESTDIR=\/usr\/local/DESTDIR=\/projects\/dists\/mbedtls/g" Makefile
LDFLAGS=-static WINDOWS_BUILD=1 make -j`nproc` install
cd ..
@aschrijver
aschrijver / RNNodeService.java
Last active May 3, 2018
RNNodeService using ScheduledExecutorService to cancel long-running NodeJS tasks (express webserver) - NOT Working
View RNNodeService.java
package world.fullcircle.nodeonandroid;
import android.app.Service;
import android.content.Intent;
import android.content.res.AssetManager;
import android.os.IBinder;
import android.util.Log;
import com.eclipsesource.v8.NodeJS;
import com.eclipsesource.v8.V8;
@mtvee
mtvee / main.cpp
Last active May 1, 2022
cross platform socket example c/c++
View main.cpp
#include<cstdio>
#include<cstring>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include<unistd.h>
@harv
harv / cross_and_static_compile_shadowsocks-libev.sh
Last active Nov 28, 2021
cross & static compile shadowsocks-libev
View cross_and_static_compile_shadowsocks-libev.sh
#!/bin/sh
# cross & static compile shadowsocks-libev
PCRE_VER=8.41
PCRE_FILE="http://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$PCRE_VER.tar.gz"
MBEDTLS_VER=2.6.0
MBEDTLS_FILE="https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz"
@ndelangen
ndelangen / simple-fork-example.js
Created Jan 2, 2017
Fork can spawn a new NodeJS process. You give it a javascript file to execute.
View simple-fork-example.js
const fork = require('child_process').fork;
const program = path.resolve('other.js');
const child = fork(program);
@Manu343726
Manu343726 / CMakeLists.txt
Created Oct 26, 2016
Configure protobuf with cmake
View CMakeLists.txt
cmake_minimum_required(VERSION 3.4)
project(MyProject)
if(NOT MY_PROJECT_PROTOBUF_VERSION)
set(MY_PROJECT_PROTOBUF_VERSION 2.6.1)
endif()
option(MY_PROJECT_SHARED_LIBS "Build proto modules as shared libraries" OFF)
message(STATUS "Google Protocol Buffers version: ${MY_PROJECT_PROTOBUF_VERSION}")
@TobleMiner
TobleMiner / blaze
Last active Dec 28, 2016
dn42 OSPF setup: Lockdown is the peering vm, blaze is the primary router and connects to lockdown via interface dn42. 'some random dn42 enabled vm' is connected to blaze via interface dn42-gw.
View blaze
protocol ospf dn42
{
table vm;
instance id 1;
export all;
import all;
area 0
{
interface "dn42"
{
@turtlemonvh
turtlemonvh / README.md
Created Aug 8, 2016
Example vagrant file
View README.md

Example vagrantfile

With ssh config adding, data directory mounted, provision script setup. 2 CPUs and 4 GB of RAM.

Create a setup bash script at provision/setup.sh and it will be run.

@halberom
halberom / 0_play.yml
Last active Nov 5, 2021
ansible - example of calling a handler when a fact is set
View 0_play.yml
---
- hosts: localhost
connection: local
gather_facts: False
tasks:
- debug: msg="call handler"
changed_when: True
notify: do something
handlers: