Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View iMilnb's full-sized avatar

iMil iMilnb

View GitHub Profile
@kabili207
kabili207 / Rclone systemd service.md
Last active April 20, 2024 15:54
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@subfuzion
subfuzion / curl.md
Last active April 20, 2024 13:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active April 18, 2024 08:54
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@Jiab77
Jiab77 / raspberry-pi-2-3-and-4-wireless-bridge-ubuntu-server-18.04-arm+netplan.md
Last active February 26, 2024 17:42
Raspberry Pi 2/3B/B+/4B Wireless Bridge using Ubuntu Server 18.04 ARM Image and Netplan

Raspberry Pi 2/3B/B+/4B Wireless Bridge using Ubuntu Server 18.04 ARM Image and Netplan

The initial goal of this project is to use the raspberry pi in place of my Wireless Range Extender and then going from 3 wireless networks (2.4ghz, 2.4ghz extended, 5ghz) at home to only one (5ghz). This way I'm reducing the exposition to radio waves for the whole familly at home.

Let's go technical

Ok, enough drama for now, let's go technical. 😁

Setup

@bowmanmike
bowmanmike / dynamic_function_calls.go
Created February 22, 2017 19:06
Golang Dynamic Function Calling
package main
import (
"fmt"
)
// Use map[string]interface{} to pair functions to name
// Could maybe use anonymous functions instead. Might be clean
// in certain cases
var funcMap = map[string]interface{}{
@flaviocopes
flaviocopes / check-substring-starts-with.go
Last active April 16, 2023 03:02
Go: check if a string starts with a substring #golang
package main
import (
"strings"
)
func main() {
strings.HasPrefix("foobar", "foo") // true
}
@peterhellberg
peterhellberg / ffserver.conf
Last active December 2, 2022 06:30
MJPEG stream from Webcam using FFServer and FFMpeg
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 200
MaxClients 100
MaxBandWidth 500000
CustomLog -
<Feed camera.ffm>
File /tmp/camera.ffm
FileMaxSize 200M
@hugomaiavieira
hugomaiavieira / lock-screen.sh
Last active September 8, 2022 16:12
Script to lock and turn off the screen on linux mint
#! /bin/bash
#
# How to use it
#
# $ chmod +x lock-screen
#
# $ ./lock-screen.sh
#
# You can create a custom keyborad shortcut (like Super+l) that call this script
#
@arpat
arpat / kibana-curl.sh
Created October 11, 2017 11:46
CURL the kibana endpoint to query Elasticsearch
#!/bin/bash
#
## CURL the kibana endpoint
## Use the kibana dev console to validate query json
curl -i --insecure --user User:Password -XPOST \
--header "kbn-version: 5.6.0" \
'https://kibana.yourdomain/api/console/proxy?path=_search&method=POST' \
--data '{"query":{"match_all":{}}}'
@justinsoliz
justinsoliz / resources.tf
Created August 30, 2016 15:26
Terraform S3 to Lambda notification
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_iam_role" "iam_for_terraform_lambda" {
name = "app_${var.app_env}_lambda"
assume_role_policy = <<EOF
{