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"
{
"jobIds": [
"20748eba-7a5f-4ac6-8ff3-5ce06a045585"
],
"results": [
{
"jobId": "20748eba-7a5f-4ac6-8ff3-5ce06a045585",
"result": {
"data": {
"descriptor": {
@AlexVKO
AlexVKO / airline.vim
Created May 24, 2020 01:43
AlexVKO airline theme
" Minimalist Airline - A Material Color Scheme
"
" Author: Diki Ananta <[email protected]>
" Repository: https://github.com/dikiaap/minimalist
" Version: 2.0
" License: MIT
let s:theme = 'alexvko'
" To highlight when the buffer is modified:
@AlexVKO
AlexVKO / curl.md
Last active March 6, 2020 16:35
Debug/Measure request time using curl

From https://stackoverflow.com/questions/18215389/how-do-i-measure-request-and-response-times-at-once-using-curl

cURL supports formatted output for the details of the request (see the cURL manpage for details, under -w, –write-out ). For our purposes we’ll focus just on the timing details that are provided.

Create a new file, curl-format.txt, and paste in:

    time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
@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>
class Queue
def initialize(max_size: nil)
@head_node = nil
@max_size = max_size
end
def enqueue(element)
if last_node
last_node.next_node = Node.new(element)
else
@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