Skip to content

Instantly share code, notes, and snippets.

@UndeRus
UndeRus / openssl-example.rs
Created November 12, 2015 09:11
Openssl minimal rust example
extern crate openssl;
use std::io::prelude::*;
use std::path::Path;
use std::net::TcpStream;
use openssl::ssl::{Ssl, SslMethod, SslContext, SslStream, SSL_VERIFY_NONE};
use openssl::x509::{X509FileType};
@region23
region23 / golang_books_sites.md
Last active January 5, 2025 14:30
Полезные ресурсы для изучающих Go

На русском языке

Русскоязычные сайты и сообщества

English resources

@tristanwietsma
tristanwietsma / auth.go
Created May 15, 2014 04:15
Golang web server example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@mitmul
mitmul / install_opencv2.4.8.sh
Last active November 24, 2024 21:24
install OpenCV 2.4.8 for CentOS 6.2
#! /bin/bash
sudo yum install -y gcc g++ gtk+-devel libjpeg-devel libtiff-devel jasper-devel libpng-devel zlib-devel cmake unzip
sudo yum install -y yum-priorities
wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum install -y eigen3-devel —enablerepo=epel
pip install numpy
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.8/opencv-2.4.8.zip
unzip opencv-2.4.8
@maxlapshin
maxlapshin / small_erlang.sh
Last active December 17, 2015 00:09
Build and clean small server erlang distribution without useless libraries
#!/bin/bash
[ -f /usr/bin/gcc ] || (apt-get update && apt-get install -y build-essential libncurses-dev libssl-dev chrpath)
#wget http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.2d.tar.gz
#tar zxf libatomic_ops-7.2d.tar.gz
#cd libatomic_ops-7.2/
#./configure --prefix=/opt/flussonic
#make install
#cd ..
@mwunsch
mwunsch / emoji_image_replace.js
Last active August 13, 2023 21:44
Detect emoji unicode on a page, replace it with images (supplied by GitHub, for now). Goes great in your ~/.js
/**
*
* Here's a thing that will look through all the text nodes of a document, and
* upon encountering an emoji codepoint, will replace it with an image.
* For now, those images are pulled from GitHub, which isn't very nice, so I
* need to find a more suitable host.
*
* Much of this code was gleaned from staring at the minified GitHub JS.
*
* Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License.
@Ripley6811
Ripley6811 / python_cv2_feature_detection.py
Created October 11, 2012 08:17
Python+OpenCV feature detection
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests the various feature detector algorithms in OpenCV 2.4 on one image
@SINCE: Thu Sep 13 23:01:23 2012
@VERSION: 0.1
@REQUIRES: OpenCV 2.4 (I used 2.4.0), matplotlib
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 12, 2025 02:24
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@deanet
deanet / google.sh
Created August 22, 2012 16:09
Uploading File into Google Drive (because grive too many dependencies qt, xorg ? )
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="[email protected]"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE