Skip to content

Instantly share code, notes, and snippets.

@AlexVKO
AlexVKO / bidirectional_clipboard.md
Created August 22, 2020 00:34 — forked from jclosure/bidirectional_clipboard.md
Setup a bi-directional shared clipboard between client macos and linux server for remote terminal emacs.

Using netcat and ssh tunnels, create a shared clipboard allowing client and server clipboards to be fused

Serve pbcopy and pbpaste on Mac's localhost

NOTE: That we are making the assumption that the clipboards are sending and receiving UTF-8 encoded bytes

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@AlexVKO
AlexVKO / reload_chrome.sh
Created July 13, 2020 20:00 — forked from jhickner/reload_chrome.sh
Reload Chrome then refocus iTerm
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
tell application "Google Chrome"
activate
tell application "System Events"
tell process "Google Chrome"
@AlexVKO
AlexVKO / remotepaste.md
Created July 23, 2018 17:08 — forked from burke/remotepaste.md
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@AlexVKO
AlexVKO / fedora 27 post
Created April 29, 2018 21:25 — forked from dschier-wtd/fedora 27 post
fedora 27 post installation hints
# Displaimer
This is not a guide or a guideline. It is a collection of ideas, tools and stuff I was/will/am use.
Everything below is very subjectiv and can change over time. If you want to use something from here,
please feel free. But please don't consider it working "as is". In most cases you have to think about stuff.
# Security
## Adjust Firewall
<port close for high ports>
@AlexVKO
AlexVKO / aws-linux-ulimit.md
Created October 17, 2017 06:05 — forked from diegopacheco/aws-linux-ulimit.md
How to Set ulimit on amazon linux | CentOS based?
sudo vim /etc/security/limits.conf
ec2-user soft nofile 65536
ec2-user hard nofile 65536

root soft nofile 65536
root hard nofile 65536
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@AlexVKO
AlexVKO / 1-server.md
Created April 20, 2017 21:19 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@AlexVKO
AlexVKO / ar_to_hash.rb
Created December 19, 2016 16:05 — forked from renancarvalhoo/ar_to_hash.rb
Convert any Activerecord to a hash with all it's related objects
class Serializer < Struct.new(:object)
#w.association_cache.keys.include?
def to_hash
@hash ||= hash_object(object)
end
private
def hash_object(object)
hash = {}
@AlexVKO
AlexVKO / .gitconfig
Created October 20, 2016 18:58 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
[
{ "keys": ["e", "u"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["c"], "command": "enter_insert_mode",