Skip to content

Instantly share code, notes, and snippets.

View wiedzmin's full-sized avatar

Alex Ermolov wiedzmin

View GitHub Profile
@wiedzmin
wiedzmin / .Title
Created December 12, 2017 09:19 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@wiedzmin
wiedzmin / GoMgoSample-1.go
Created December 12, 2017 09:25 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
** python-mode
#+begin_src emacs-lisp
(use-package python
:mode ("\\.py" . python-mode)
:config
(setq py-python-command "python3")
(setq python-shell-interpreter "python3")
(setq python-indent-offset 4)
@wiedzmin
wiedzmin / _tmux_pane_words.zsh
Created January 19, 2018 16:17 — forked from blueyed/_tmux_pane_words.zsh
ZSH configuration to complete words from tmux pane(s)
# Complete words from tmux pane(s) {{{1
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html
# Gist: https://gist.github.com/blueyed/6856354
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1
fi
FROM golang:1.8.5-jessie as builder
# install xz
RUN apt-get update && apt-get install -y \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# install UPX
ADD https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-3.94-amd64_linux.tar.xz | \
tar -xOf - upx-3.94-amd64_linux/upx > /bin/upx && \
chmod a+x /bin/upx
@wiedzmin
wiedzmin / _README.md
Created February 15, 2018 11:05 — forked from schickling/_README.md
Script to import and export docker-machine configurations to sync between hosts/collaborators

docker-machine import/export

Script to import and export docker-machine configurations to sync between hosts/collaborators

Export (on host A)

$ docker-machine ls
NAME       ACTIVE   DRIVER         STATE     URL                            SWARM   DOCKER    ERRORS
dev        -        digitalocean   Running   tcp://example.com:2376                 v1.10.1
@wiedzmin
wiedzmin / .keysnail.js
Created March 1, 2018 12:14
my keysnail set up
// ========================== KeySnail Init File =========================== //
// You can preserve your code in this area when generating the init file using GUI.
// Put all your code except special key, set*key, hook, blacklist.
// ========================================================================= //
//{{%PRESERVE%
// Put your codes here
//}}%PRESERVE%
// ========================================================================= //
@wiedzmin
wiedzmin / gist:b15419c5b45fbe7db5be26046996f71a
Created March 1, 2018 20:27 — forked from haxney/gist:3055728
List monospace fonts in Emacs
;; Display all the monospace fonts available to Emacs in a dedicated buffer
(defun font-is-mono-p (font-family)
;; with-selected-window
(let ((wind (selected-window))
m-width l-width)
(with-current-buffer "asdf"
(set-window-buffer (selected-window) (current-buffer))
(text-scale-set 4)
(insert (propertize "l l l l l" 'face `((:family ,font-family))))
;; see https://github.com/lolownia/org-pomodoro
;; and use case from http://headhole.org/organisation/2012/08/22/org-mode-gtd-and-the-pomodoro-technique/
(use-package org-pomodoro
:config
(global-set-key (kbd "M-<f11>") 'org-pomodoro)
(global-set-key (kbd "s-<f11>") 'org-pomodoro)
;; (global-set-key (kbd "C-c C-x C-i") 'org-pomodoro)
;; (global-set-key (kbd "C-c C-x C-o") 'org-pomodoro)
@wiedzmin
wiedzmin / gsm-setup.md
Created March 5, 2018 13:43 — forked from heyalexej/gsm-setup.md
SIM Card Management Through GSM Modem On Linux

SIM Card Management Over GSM Modem

A small guide on how to send and receive USSD codes on Linux

I am using the built in GSM (UMTS) modem of my Thinkpad X1 extensively because I am often in places with flaky internet connections. I connect through the standard Network Manager on Ubuntu and everything works fine. There was one major annoyance though. Every time I wanted to top up the SIM balance or book a new package, I needed a phone to send and receive USSD codes. So I took some time to figure out how to do it from the shell. I wrote this down as a help for others and a reminder for myself. Without further ado...

First intsall gammu and picocom.

~  sudo apt-get install -y gammu picocom