Skip to content

Instantly share code, notes, and snippets.

@cyrenity
cyrenity / compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
Last active February 16, 2024 06:10
Install FreeSWITCH 1.10.7 on Ubuntu 20.04 LTS

Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | Ubuntu 20.04 LTS

Introduction

FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine

This guide demonstrates how to get it install FreeSWITCH and get it up and running on a Ubuntu 20.04 LTS machine

Prerequisites

To follow along with this guide, you need one Ubuntu 20.04 LTS server which has prerequisite packages installed and configured. In order to install required packages issue following command

@chenshengzhi
chenshengzhi / git_ssh_proxy.md
Last active April 13, 2024 09:40
git ssh 代理设置

仅为 GitHub 设置代理

git 代理

设置 git config --global http.https://github.com.proxy socks5://127.0.0.1:1086
设置完成后, ~/.gitconfig 文件中会增加以下条目:

[http "https://github.com"]
    proxy = socks5://127.0.0.1:1086
@fno2010
fno2010 / wacom-mac-remover.sh
Created December 14, 2018 19:31
Clear all the installed files by Wacom Driver
#/bin/bash
# Clear all the installed files by Wacom Driver
rm -rf /Applications/Wacom\ Tablet.localized
rm -rf /Applications/Pen\ Tablet.localized
rm -rf /Library/Application\ Support/Tablet
rm -rf /Library/Extensions/Wacom\ Tablet.kext
@robbie-cao
robbie-cao / libuv-vs-libev.md
Created January 3, 2017 12:12
libuv vs libev

libuv 和 libev ,两个名字相当相近的 I/O Library,最近有幸用两个 Library 都写了一些东西,下面就来说一说我本人对两者共同与不同点的主观表述。

高性能网络编程这个话题已经被讨论烂了。异步,异步,还是异步。不管是 epoll 也好,kqueue 也罢,总是免不了异步这个话题。

libuv是异步的,libev是同步的多路IO复用。

libev 是系统I/O复用的简单封装,基本上来说,它解决了 epoll ,kqueuq 与 select 之间 API 不同的问题。保证使用 livev 的 API 编写出的程序可以在大多数 *nix 平台上运行。但是 libev 的缺点也是显而易见,由于基本只是封装了 Event Library,用起来有诸多不便。比如 accept(3) 连接以后需要手动 setnonblocking。从 socket 读写时需要检测 EAGAIN 、EWOULDBLOCK 和 EINTER 。这也是大多数人认为异步程序难写的根本原因。

libuv 则显得更为高层。libuv 是 joyent 给 Node 做的一套 I/O Library 。而这也导致了 libuv 最大的特点就是处处回调。基本上只要有可能阻塞的地方,libuv 都使用回调处理。这样做实际上大大减轻了程序员的工作量。因为当回调被 call 的时候,libuv 保证你有事可做,这样 EAGAIN 和 EWOULDBLOCK 之类的 handle 就不是程序员的工作了,libuv 会默默的帮你搞定。

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

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

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

启动新会话:

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

恢复会话:

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 20:51
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@v5tech
v5tech / linux-http-tcp.md
Last active February 3, 2023 07:13
linux下查看http 并发和 tcp连接数

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@markyun
markyun / gist:6061416
Last active April 13, 2024 05:57
国内各大互联网公司相关技术站点2.0版 (集合腾讯、阿里、百度、搜狐、新浪、360等共49个)
国内各大互联网公司相关技术站点2.0版 (集合腾讯、阿里、百度、搜狐、新浪、360等共49个)
利用闲暇时间整理了一份国内各大互联网公司的相关技术站点,希望能够对大家有所帮助,也欢迎各位帮忙补充。
腾讯系列(13) 阿里系列(18) 百度系列(3) 搜狐系列(3) 新浪系列(2) 360系列(2) 其他(9)
腾讯系列(13)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jboner
jboner / latency.txt
Last active May 5, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD