Skip to content

Instantly share code, notes, and snippets.

View gris-gris's full-sized avatar
🗿
I may be slow to respond.

Alex Efimov gris-gris

🗿
I may be slow to respond.
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@joshuar
joshuar / Three-Node-LustreFS-Cluster-Quickstart.md
Last active July 22, 2020 09:52
Quick three-node Lustre set-up on CentOS 6
@AubreyHewes
AubreyHewes / ubuntu-install-bitchx.sh
Created January 21, 2015 23:24
Compile and Install BitchX on Ubuntu
#!/bin/sh
####################################################################################
#
# Download Compile and Install BitchX on Ubuntu
#
####################################################################################
# download bitchx source
# @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
@matriphe
matriphe / ssh-telegram.sh
Last active May 7, 2023 15:00
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
@k4ml
k4ml / tgbot.py
Created June 27, 2015 22:49
Example telegram bot
import bottle
import requests
@bottle.route('/', method='POST')
def telegram_bot():
data = bottle.request.json
url = 'https://api.telegram.org/bot<YOUR_TOKEN>/sendMessage'
try:
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 25, 2024 06:10
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@adamierymenko
adamierymenko / zerotier_rules_example.ztrd
Last active June 13, 2023 17:57
An example of what an advanced ZeroTier network rule set might look like
# This is an example from a work in progress, so final versions might
# be slightly different. Don't use as a guide after release!
# Define rule set macros
# Whitelist a TCP destination port on the network. Use this as a template to
# make your own rule sets for more advanced criteria like tag matches, etc.
# This works for both IPv4 and IPv6. Add an ethertype match to restrict it to
# one or the other.
macro tcp_whitelist_dest_port($port)
@sforshee
sforshee / erl3-example-config.txt
Last active April 7, 2023 22:46
Example configuration for Ubiquiti EdgeRouter Lite 3
# EdgeRouter Lite 3 configuration example based on the walkthroughs starting
# with
# http://www.forshee.me/2016/03/01/ubiquiti-edgerouter-lite-setup-part-1-the-basics.html.
#
# Demonstrates a network setup utilizing VLANs, a zone-based firewall, and
# an OpenVPN server. The network has VLANs to segregate home and home-office
# network traffic, plus a management VLAN for "smart" networking equipment.
# The office VLAN has administrative access to web and SSH interfaces on the
# router and the management VLAN whereas the home network does not.
#