Skip to content

Instantly share code, notes, and snippets.

View szampardi's full-sized avatar

Silvano Zampardi szampardi

View GitHub Profile
@smallnest
smallnest / fork_and_daemon.go
Created April 20, 2020 06:52 — forked from wrfly/fork_and_daemon.go
golang fork and exec and handle signals
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
)
@arjunv
arjunv / keyevents.json
Created December 2, 2018 00:01
All Android Key Events for usage with adb shell
{
"key_events": {
"key_unknown": "adb shell input keyevent 0",
"key_soft_left": "adb shell input keyevent 1",
"key_soft_right": "adb shell input keyevent 2",
"key_home": "adb shell input keyevent 3",
"key_back": "adb shell input keyevent 4",
"key_call": "adb shell input keyevent 5",
"key_endcall": "adb shell input keyevent 6",
"key_0": "adb shell input keyevent 7",
@mraaroncruz
mraaroncruz / steps.md
Last active June 9, 2024 06:31
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999

@petemoore
petemoore / main_windows.go
Last active November 3, 2023 06:40
Running process as interactive user from windows service with UAC process elevation
package main
import (
"context"
"errors"
"fmt"
"log"
"os"
"os/exec"
"syscall"
@heralight
heralight / gen-dummy-package.sh
Created November 3, 2015 17:59
A script to generate dummy debian package with equivs to bypass crazy dependencies
#!/bin/bash
installPackage=false
function process
{
packageName=$1
echo "######### key : $packageName"
v=$(eval "apt-cache policy $packageName | grep 'Candidate:' | cut -c 14-")
echo "######### version: $v"
@plentz
plentz / nginx.conf
Last active June 11, 2024 06:55
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@jordanorelli
jordanorelli / example.go
Created April 7, 2012 19:22
a regex router in go.
package main
import (
"fmt"
"io"
"log"
"routes"
"net/http"
)