Skip to content

Instantly share code, notes, and snippets.

View chichivica's full-sized avatar

Ivan Talalaev chichivica

View GitHub Profile
@subfuzion
subfuzion / curl.md
Last active May 9, 2024 18:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@regeda
regeda / underscore.go
Last active December 12, 2018 10:23
Convert CamelCase to underscore in golang with UTF-8 support.
package main
import (
"testing"
"unicode"
"unicode/utf8"
"github.com/stretchr/testify/assert"
)
@underdoeg
underdoeg / hx711.py
Last active August 26, 2023 23:33
Python port for RaspberryPI of the HX711 Breakout Board
import RPi.GPIO as GPIO
import time
def createBoolList(size=8):
ret = []
for i in range(8):
ret.append(False)
return ret
@gmacario
gmacario / Dockerfile
Last active November 23, 2021 02:40
Can you run GUI apps in Docker?
# From http://stackoverflow.com/questions/16296753/can-you-run-gui-apps-in-a-docker
#
# Firefox over VNC
#
# VERSION 0.1
# DOCKER-VERSION 0.2
from ubuntu:12.04
# make sure the package repository is up to date
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
@niccokunzmann
niccokunzmann / hanging_threads.py
Last active September 27, 2023 08:13
This module prints all hanging threads that are dead locked. It is for Python 2 and 3. Installable: https://pypi.python.org/pypi/hanging_threads
## The MIT License (MIT)
## ---------------------
##
## Copyright (C) 2014 Nicco Kunzmann
##
## https://gist.github.com/niccokunzmann/6038331
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the "Software"),
@aspyct
aspyct / signal.c
Last active February 19, 2024 11:24
Unix signal handling example in C, SIGINT, SIGALRM, SIGHUP...
/**
* More info?
* a.dotreppe@aspyct.org
* http://aspyct.org
*
* Hope it helps :)
*/
#include <stdio.h>
#include <stdlib.h>
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@aspyct
aspyct / common.h
Created July 15, 2012 22:00
Unix semaphore with the C programming language, tested under Debian
#ifndef _COMMON_H_
#define _COMMON_H_
#define SEM_KEY_FILE ("sem.key")
#endif /* _COMMON_H_ */
@rduplain
rduplain / README.md
Created October 17, 2011 20:04
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini: