Skip to content

Instantly share code, notes, and snippets.

View shawnfeng0's full-sized avatar
💭
Keep thinking

Shawn Feng shawnfeng0

💭
Keep thinking
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2025 14:55
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andreibosco
andreibosco / gist:8246142
Created January 3, 2014 20:39
Wifi configuration on archlinux ARM

Fonte: http://raspberrypi.stackexchange.com/questions/7987/wifi-configuration-on-arch-linux-arm

The deprecated netcfg used /etc/network.d/ to store profiles. The successor of netcfg is netctl.

In order to setup a wireless network, install netctl using sudo pacman -S netctl. Next, you have to create a network profile. /etc/netctl/examples/ contains some examples. Let's assume you want to setup a WPA2-PSK network. Simply copy over the example file and start editing:

/etc/netctl# install -m640 examples/wireless-wpa wireless-home
/etc/netctl# cat wireless-home
Description='A simple WPA encrypted wireless connection'
@guweigang
guweigang / git_toturial
Last active June 1, 2025 08:59
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "[email protected]" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://[email protected]/VT.git # clone远程仓库
@huandu
huandu / macro_strrchr.cpp
Created July 12, 2014 15:13
A macro implementation of `strrchr()`
#include <iostream>
using namespace std;
#define _STRRCHR_IMPL_COMMON(str, ch, offset) (str)[sizeof((str)) - 1 - (offset)] == (ch)? (str) + sizeof((str)) - (offset): sizeof((str)) <= (offset) + 1? (str)
#define _STRRCHR_IMPL_31(str, ch) (_STRRCHR_IMPL_COMMON(str, ch, 31): (str))
#define _STRRCHR_IMPL_30(str, ch) (_STRRCHR_IMPL_COMMON(str, ch, 30): _STRRCHR_IMPL_31(str, ch))
#define _STRRCHR_IMPL_29(str, ch) (_STRRCHR_IMPL_COMMON(str, ch, 29): _STRRCHR_IMPL_30(str, ch))
#define _STRRCHR_IMPL_28(str, ch) (_STRRCHR_IMPL_COMMON(str, ch, 28): _STRRCHR_IMPL_29(str, ch))
#define _STRRCHR_IMPL_27(str, ch) (_STRRCHR_IMPL_COMMON(str, ch, 27): _STRRCHR_IMPL_28(str, ch))
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@whoshuu
whoshuu / curlget.cpp
Created March 31, 2015 06:44
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
@flbuddymooreiv
flbuddymooreiv / passgitgpg.md
Last active June 27, 2025 17:40
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@ryerh
ryerh / tmux-cheatsheet.markdown
Last active June 28, 2025 06:14 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

Pty Language Age/Gender VoiceName File Other Languages
2 en-gb M english en (en-uk 2)(en 2)
3 en-uk M english-mb-en1 mb/mb-en1 (en 2)
2 en-us M english-us en-us (en-r 5)(en 3)
5 en-sc M en-scottish other/en-sc (en 4)
5 en M default default
5 en-uk-north M english-north other/en-n (en-uk 3)(en 5)
5 en-uk-rp M english_rp other/en-rp (en-uk 4)(en 5)
5 en-us M us-mbrola-2 mb/mb-us2 (en 7)
5 en-us F us-mbrola-1 mb/mb-us1 (en 8)
@khancyr
khancyr / CMakeLists.txt
Last active October 16, 2024 12:03
Ardupilot clion
cmake_minimum_required(VERSION 3.5)
project(Ardupilot)
add_compile_options(-std=c++11)
set(TARGET_PLATFORM sitl)
#set(TARGET_PLATFORM chibios)
#set(TARGET_PLATFORM linux)
string(TOUPPER ${TARGET_PLATFORM} TARGET_PLATFORM_UPPER)
# To work with SITL