Skip to content

Instantly share code, notes, and snippets.

@ivan-leschinsky
ivan-leschinsky / synology_ssh.md
Created March 29, 2019 21:18
How to add SSH access by pubkey for synology

How to SSH to synology without password (pubkey)

  1. After login to your user, enter root session:
sudo -i
  1. Edit SSHD config:
vi /etc/ssh/sshd_config
@ivan-leschinsky
ivan-leschinsky / debug_webpack.md
Last active November 1, 2018 11:05
how to user debugger in the rails webpacker setup

how to user debugger in the rails webpacker setup:

node  --inspect --debug-brk node_modules/webpack/bin/webpack.js --config config/webpack/development.js

then in chrome go to this url and open dedicated debugger for node:

chrome://inspect
@ivan-leschinsky
ivan-leschinsky / digispark_little_wire.rb
Created June 28, 2018 15:01
digispark little wire sample code
wire = LittleWire.connect
wire.pin_mode :pin1, :out
loop do
wire.digital_write :pin1, :vcc
sleep 0.5
wire.digital_write :pin1, :gnd
sleep 0.5
end
@ivan-leschinsky
ivan-leschinsky / pre-push.sh
Created March 28, 2018 12:17
Github compare branches link in the push message
#!/bin/sh
# put to the .git/hooks/pre-push
while read local_ref local_sha remote_ref remote_sha
do
printf "%0.s*" {1..100}
printf "\n"
echo "*** Create PR using this link: https://github.com/ORG/REPO_NAME/compare/$remote_ref?expand=1"
printf "%0.s*" {1..100}
// Bot for http://gabrielecirulli.github.io/2048/
FakeActuator = function() {}
FakeActuator.prototype.actuate = function () {
}
score = 0;
max = 0;
maxReach = 512;
@ivan-leschinsky
ivan-leschinsky / node.service
Created January 30, 2018 21:14 — forked from Dianoga/node.service
systemd .service file for node.js app. Requires forever.
[Unit]
Description=Start Herir Node.js Service
Requires=network.target
After=network.target
[Service]
Type=forking
WorkingDirectory=/srv/hereir/node
ExecStart=/usr/bin/forever start --pidFile /var/run/hereir.pid HereIR.js
ExecStop=/usr/bin/forever stop HereIR.js
@ivan-leschinsky
ivan-leschinsky / git-commit-log-stats.md
Created December 6, 2017 07:40 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@ivan-leschinsky
ivan-leschinsky / disable.sh
Created November 28, 2017 10:21
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@ivan-leschinsky
ivan-leschinsky / heroku_pg_backup.md
Last active October 30, 2017 20:09 — forked from kagemusha/gist:1569836
Dump Heroku Postgres DB and load locally
@ivan-leschinsky
ivan-leschinsky / playpause.applescript
Last active August 26, 2025 19:44
Applescript play/pause scripts for the VLC, iTunes, Spotify, Deezer
(*
-- When running each app separately
tell application "Deezer"
if it is running then
set old to (path to frontmost application as text)
tell application "Deezer"
reopen
activate
end tell
tell application "System Events" to key code 49