Skip to content

Instantly share code, notes, and snippets.

View kakty3's full-sized avatar

Sergey Demurin kakty3

View GitHub Profile
@emanueljacob
emanueljacob / zsh_bash_keybindings_alt-arrow_mac.sh
Last active August 27, 2019 13:17
Alt + Arrow Key Bindings for JetBrains IntelliJ/PhpStorm on MacOS
# Currently the embedded terminal of Jetbrains IDEs does not make use of keybindings defined in terminal/iterm on mac
# Instead yo get the ring bell and output like [C or [D
#
# see: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000013224-Alt-key-not-working-in-embedded-terminal
#
# to fix it and allow ALT + Arrow in the the IDEs embedded terminal just do the following (depending on wich shell you use)
# If you use zsh
# Add this to ~/.zshrc :
bindkey "\e\eOD" backward-word
@l4u
l4u / autojump_fzf.fish
Created December 13, 2017 03:10
autojump(macOS) + fzf for fish shell
alias j="cd (cat ~/Library/autojump/autojump.txt | sort -nr | awk '{print \$2}' | fzf +s)"
@scottopell
scottopell / fix_exfat_drive.md
Last active May 12, 2024 22:28
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@xVir
xVir / vpn.md
Created August 29, 2016 07:16
Scripts for enabling and disabling VPN in Control Plane

This script will be usefull if you want to enable VPN automatically on coming to work and to disable it on escaping from work using great Control Plane app.

It is assumed that you use Tunnelblick to manage VPN connections.

To connect to VPN:

set q to "<your_connection_name>"
tell application "Tunnelblick"
	set configs to get name of configurations
	if q is in configs then
@mbbx6spp
mbbx6spp / ALTERNATIVES.adoc
Last active April 25, 2024 15:14
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 11, 2024 17:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@arobson
arobson / abstractions.md
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@bancek
bancek / ssh-detach.txt
Created September 13, 2013 09:51
Detach SSH session
<enter>~.