Skip to content

Instantly share code, notes, and snippets.

View doytsujin's full-sized avatar
🎯
Private Account

Alexander Chernov doytsujin

🎯
Private Account
  • @doytsujin.com
  • Toronto, Canada
  • 22:24 (UTC -04:00)
View GitHub Profile
@doytsujin
doytsujin / gist:e561dc5ffdf88ed8311c85d32fb44359
Created May 17, 2017 18:06 — forked from iamzhout/gist:38ad08d2d8eacda8184f0766639641a5
NoSleep.exe - Prevents Screensaver and PC Locking - By Mike.Langford
# original URL: https://www.symantec.com/connect/downloads/readynosleepexe-prevents-screensaver-and-pc-locking
#AutoIt3Wrapper_icon=nosleep.ico
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
$AboutItem = TrayCreateItem("About")
TrayItemSetOnEvent(-1,"ReadList")
TrayCreateItem("")
@doytsujin
doytsujin / rotate-screen.sh
Created December 27, 2017 21:05 — forked from rubo77/rotate-screen.sh
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'
@doytsujin
doytsujin / rotate_desktop.sh
Created December 27, 2017 21:05 — forked from mildmojo/rotate_desktop.sh
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
@doytsujin
doytsujin / nginx.conf
Created January 9, 2018 16:59 — forked from regadas/nginx.conf
nginx cached forward proxy #example
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
use epoll;
}
@doytsujin
doytsujin / 00-elk-stack-sshd-log-analysis.md
Created January 30, 2018 19:43 — forked from tsaarni/00-elk-stack-sshd-log-analysis.md
Using ELK stack (Elasticsearch + Logstash + Kibana) for offline SSHD log analysis

Using ELK stack for offline SSHD log analysis

To start Elasticsearch + Logstash + Kibana execute:

docker-compose up

The container images will be downloaded from docker hub at first run.

Next, import the log file data to logstash

@doytsujin
doytsujin / H2EmbeddedTest.java
Created April 22, 2018 14:33 — forked from omnisis/H2EmbeddedTest.java
Configuring H2 database for unit tests w/ spring
package examples.database;
import com.google.common.collect.Lists;
import examples.database.dao.PeopleDAO;
import examples.database.model.PeopleInfo;
import org.apache.commons.lang.time.StopWatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
@doytsujin
doytsujin / README.md
Created May 4, 2018 18:31 — forked from kmassada/README.md
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
import akka.actor._
class EchoActor extends Actor {
def receive = {
case msg => println(s"${self.path.name} - New msg received: $msg")
}
}
@doytsujin
doytsujin / aggs.sh
Created June 11, 2018 18:35 — forked from jprante/aggs.sh
Elasticsearch aggregations demo
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test' -d '
{
"mappings" : {
"_default_": {
"properties" : {
"name" : { "type" : "string" },
"age" : { "type" : "integer" },
@doytsujin
doytsujin / grafana-dashboard-exporter
Created August 23, 2018 17:59 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done