Skip to content

Instantly share code, notes, and snippets.

gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Alt>Shift_L','<Shift>Alt_L']"
@grinat
grinat / sound_recorder.py
Created October 9, 2019 20:45 — forked from mabdrabo/sound_recorder.py
Simple script to record sound from the microphone, dependencies: easy_install pyaudio
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@grinat
grinat / index.html
Created July 8, 2019 22:16 — forked from zross/index.html
Animate path on Leaflet map using D3 (Gimme!, Proletariat)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />
@grinat
grinat / change-collation.sql
Last active January 15, 2019 20:21
Change collation in all columns and tables in mysql
select CONCAT('ALTER TABLE ',TABLE_NAME,' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') from information_schema.TABLES WHERE TABLE_SCHEMA != 'information_schema';
version: '2'
services:
nginx:
image: nginx
container_name: nginx-container
networks:
static-network:
ipv4_address: 172.20.128.2
networks:
static-network:
@grinat
grinat / msi-gtx1060-ubuntu-18.04-deeplearning.md
Created September 14, 2018 20:13 — forked from hereismari/msi-gtx1060-ubuntu-18.04-deeplearning.md
Setting up a MSI laptop with GPU (gtx1060), Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow
# docker volume create --name=go-vue-blog-mongo-data
# backup external volume
docker-compose down
docker run --rm -v go-vue-blog-mongo-data:/data -v /var/backups/go-vue-blog:/backup ubuntu tar cvf /backup/go-vue-blog-mongo-data_travic-build-7.tar /data
# restore external volume
docker-compose down
docker run --rm -v go-vue-blog-mongo-data:/data -v /var/backups/go-vue-blog:/backup ubuntu bash -c "cd /data && rm -rf * && tar xvf /backup/go-vue-blog-mongo-data_travic-build-7.tar --strip 1"
@grinat
grinat / GitConfigHttpProxy.md
Created August 24, 2018 13:51 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

<div class="img-container"><img src="picture.png" class="cropped"/></div>
div.img-container {
width: 390px;
height: 211px;
position: relative;
margin-left: auto;
margin-right: auto;
overflow: hidden;
# if windows
docker-machine env default
@FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
# connect to docker
docker exec -i -t healthy-eating-php /bin/sh