Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 4, 2024 17:58
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@jordic
jordic / ssh.go
Created May 27, 2014 14:03
golang mysql throught a tunnel
package main
// based on gist
// https://gist.github.com/ir4y/11146415
// http://stackoverflow.com/questions/21417223/simple-ssh-port-forward-in-golang
// obro conexio ssh amb el server remot.
// tot el que envio al port local ho copio al port remote
// a traves de la conexio remota. Per tant he d'obrir un
// port a la maquina remota?
@gelldur
gelldur / .clang-format
Last active June 27, 2024 21:15
My clang format file. In sample.cpp is sample output
# Checkout config tool: https://zed0.co.uk/clang-format-configurator/
# Or http://cf.monofraps.net/
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# https://github.com/01org/parameter-framework/blob/master/.clang-format
# Tested on: clang-format version 6.0.1
# Common settings
BasedOnStyle: WebKit
@parthitce
parthitce / bluez_adapter_filter.c
Last active November 17, 2022 22:58
SetDiscoveryFilter + StartDiscovery: Control discovery filter and scan for new devices
/*
* bluez_adapter_filter.c - Set discovery filter, Scan for bluetooth devices
* - Control three discovery filter parameter from command line,
* - auto/bredr/le
* - RSSI (0:very close range to -100:far away)
* - UUID (only one as of now)
* Example run: ./bin/bluez_adapter_filter bredr 100 00001105-0000-1000-8000-00805f9b34fb
* - This example scans for new devices after powering the adapter, if any devices
* appeared in /org/hciX/dev_XX_YY_ZZ_AA_BB_CC, it is monitered using "InterfaceAdded"
* signal and all the properties of the device is printed