Skip to content

Instantly share code, notes, and snippets.

View snikulov's full-sized avatar
💭
I may be slow to respond.

Sergei Nikulov snikulov

💭
I may be slow to respond.
View GitHub Profile
@athurg
athurg / dbm.c
Created March 25, 2011 05:07
a example code for gdbm using
/* db_add.c: storing
written by rock <shirock@residence.educities.edu.tw>, 1999.11.29
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gdbm.h>
#define datum_set(um, buf) { um.dptr = buf; um.dsize = strlen(buf); }
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@yoggy
yoggy / SerialPort.cpp
Created August 11, 2012 10:58
SerialPort class sample using boost::asio::serial_port
#include "StdAfx.h"
#include <Setupapi.h>
#pragma comment(lib, "Setupapi.lib")
#include "SerialPort.h"
SerialPort::SerialPort(void) : end_of_line_char_('\n')
{
}

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References

@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@bathizte
bathizte / lighttpd_transmission_proxy.conf
Last active January 30, 2024 09:26
Lighttpd CORS reverse proxy for transmission
# Lighttpd as a CORS reverse proxy to Transmission XML-RPC API
server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_proxy"
)
server.document-root = "/var/www"
# CORS preflighted request (HTTP OPTIONS) not handled yet by Transmission : Emulate a 200 OK
$HTTP["request-method"] =~ "^OPTIONS$" {
@gvanem
gvanem / SnmpMgr.c
Last active December 13, 2018 19:46
Windows SNMP client with libcurl
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@mbodo
mbodo / Linux - Systemd cheatsheet.md
Last active June 14, 2024 08:48
Systemd cheatsheet

Linux - Systemd cheatsheet

systemctl

Activates a service immediately:

systemctl start foo.service

Deactivates a service immediately:

@ArseniyShestakov
ArseniyShestakov / add.sh
Last active August 25, 2023 14:14
My compiler alternatives
# Cleanup old alternatives
update-alternatives --remove-all cc
update-alternatives --remove-all c++
update-alternatives --remove-all gcc
update-alternatives --remove-all g++
update-alternatives --remove-all clang
update-alternatives --remove-all clang++
update-alternatives --remove-all icc
update-alternatives --remove-all icc++