Skip to content

Instantly share code, notes, and snippets.

@fmela
fmela / stacktrace.cxx
Last active September 22, 2023 10:58
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@prwhite
prwhite / Makefile
Last active July 16, 2024 02:14
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active July 16, 2024 17:25
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@knugie
knugie / install_makemkv.sh
Last active November 23, 2016 06:17
Ubuntu - Install MakeMKV 1.9.0
sudo apt-get install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libgl1-mesa-dev libqt4-dev
wget http://www.makemkv.com/download/makemkv-oss-1.9.0.tar.gz
wget http://www.makemkv.com/download/makemkv-bin-1.9.0.tar.gz
tar -xvf makemkv-oss-1.9.0.tar.gz
tar -xvf makemkv-bin-1.9.0.tar.gz
cd makemkv-oss-1.9.0/
./configure
make
sudo make install
@grzhan
grzhan / chsdir
Created October 13, 2015 10:22
Linux Shell下的目录拼音补全,出处:https://code.google.com/p/easyscripts/wiki/chsdir
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# shaozx@gmail.com 2009-05-04
#
# Description: 在控制台使用 cd 命令时用拼音补全中文路径
#
# 实验目录如下:
# biff@lenovo:/domain/WorkSpace$ ls
# SVN培训 全球眼 浙江建行 浙江农信
#
@jlgerber
jlgerber / CMakeLists.txt
Last active May 21, 2024 20:28
cmake - handling executable and library with same name
# Lets say we want to add a library and an executable, both with the same name.
# In this example, it is resman
add_library(resman ${src_cpps} ${src_hpps} )
target_link_libraries(resman ${Boost_LIBRARIES} ${LIBYAML} ${LIBFMT})
#
# Add resman executable
#
# We call the executable resman-bin
add_executable(resman-bin main.cpp )
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active July 2, 2024 18:37
Detect new network devices connecting to OpenWrt and send text message
@xjdrew
xjdrew / squid_https.md
Last active October 18, 2023 17:10
配置squid https代理

编译

通过ubuntuapt-get安装的squid没有启用ssl功能,需要手动编译。

编译squid步骤如下。

安装依赖及获取源代码

apt-get install openssl libssl-dev ssl-cert
apt-get source squid
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 23, 2024 08:15 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@braian87b
braian87b / image-builder-openwrt-lede.sh
Last active February 20, 2024 03:01
Image-Builder Procedure for OpenWRT - LEDE
# ------------------------------------------------------------------------
# Image-Builder Procedure for OpenWRT - LEDE (In this case using Debian x64 NetInstall virtual machine)
# ------------------------------------------------------------------------
su
apt-get update # Optional, make and upgrade too in case it has too many old pakackes.
apt-get install make aria2 screen ncftp -y
screen -
cd ~