Skip to content

Instantly share code, notes, and snippets.

View WesleyCh3n's full-sized avatar
😺

WesleyCh3n WesleyCh3n

😺
View GitHub Profile
@renzok
renzok / Dockerfile
Last active September 6, 2023 04:55
docker: mapping host uid and gid to user inisde container
FROM debian:jessie
ENV USER=boatswain USER_ID=1000 USER_GID=1000
# now creating user
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@jsancheznet
jsancheznet / static-lib-howto-msvc.txt
Created March 4, 2016 17:43
Building Static Library in MSVC Command Line
When you build on the Visual Studio command line, you must build the program in two steps.
First, run cl /c /EHsc MyLib.cpp to compile the code and create an object file that's named MyLib.obj.
(The cl command invokes the compiler, Cl.exe, and the /c option specifies compile without linking. For more information, see /c (Compile Without Linking).)
Second, run lib MathFuncsLib.obj to link the code and create the static library MathFuncsLib.lib.
(The lib command invokes the Library Manager, Lib.exe. For more information, see LIB Reference.)
@danidiaz
danidiaz / netrw.txt
Created October 7, 2016 20:57
Vim's netrw commands.
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
@tboerger
tboerger / gist:4840e1b5464fc26fbb165b168be23345
Created February 17, 2017 09:37
Golang LDAP search and authentication
package main
import (
"fmt"
"strings"
"gopkg.in/ldap.v2"
)
const (
ldapServer = "ad.example.com:389"
@ubergesundheit
ubergesundheit / index.md
Created November 6, 2017 13:19
ngrok on raspberrypi on systemd
  • Download ngrok binary
  • Create /etc/systemd/system/ngrok.service
  • Create /opt/ngrok/ngrok.yml
@diegopacheco
diegopacheco / latest-protobuf-ubuntu-18-04.md
Created June 7, 2018 20:13
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
@carry0987
carry0987 / RPi3-Auto-WiFi.md
Last active May 28, 2024 15:21
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connection

Before you start, make sure ip command is available on your system. In modern Linux distributions, ip replaces older ifconfig command. If net-tools package (that includes ifconfig) is not installed and you prefer using it, you can install it via sudo apt-get install net-tools.

Create script file

Use touch /home/pi/wifi-reconnect.sh to create a shell script file, with the following content:

#!/bin/bash
@elalemanyo
elalemanyo / README.md
Last active June 3, 2024 02:38
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.