Пешеходные зоны
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setopt autocd | |
setopt CORRECT | |
autoload -U compinit | |
compinit | |
#zmodload zsh/complist | |
zstyle ':completion:*' menu yes select | |
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} | |
zstyle ':completion:*:processes' command 'ps -xuf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .tmux.conf: | |
bind-key -temacs-copy M-w copy-pipe "tmux_send_clip.sh" | |
# cat $HOME/bin/tmux_send_clip.sh: | |
#!/bin/sh | |
function maybe_show_err { | |
if [ $? -ne 0 ] | |
then | |
ERROR=$(</tmp/err) | |
tmux display-message "$? $ERROR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
F = fun(F, Fd) -> receive stop -> io:format(Fd, "stop~n", []), file:close(Fd), ok; Msg -> io:format(Fd, "~p~n", [Msg]), F(F, Fd) end end. | |
{ok, Fd} = file:open("/tmp/trace.out", [write]), Tracer = proc_lib:spawn(fun() -> F(F, Fd) end). | |
%% trace everything | |
erlang:trace(Pid, true, [all, {tracer, Tracer}]). | |
%% stop tracing | |
erlang:trace(Pid, false, [all, {tracer, Tracer}]). | |
Tracer ! stop. | |
%% match pattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osx-host$ boot2docker ssh | |
sudo su - | |
cd /var/lib/boot2docker/ | |
cat <<EOF >bootlocal.sh | |
#!/bin/sh | |
cp /Users/ivan.dyachkov/MyCA.crt /usr/local/share/ca-certificates/ | |
CERT=/usr/local/share/ca-certificates/MyCA.crt | |
HASH=$(openssl x509 -hash -in $CERT | head -n1) | |
ln -s $CERT /etc/ssl/certs/$HASH.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unbind C-b | |
set-option -g prefix C-a | |
bind C-a send-prefix | |
set-option -g default-terminal "screen-256color" | |
bind-key -temacs-copy M-w copy-pipe "tmux_send_clip.sh" | |
set-option -g default-command "/bin/bash && source ~/.bashrc" | |
set-option -g status-bg black | |
set-option -g status-fg white | |
set-option -g status-left ‘#[fg=green]#H’ | |
set-option -g visual-activity on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OpensslAT11 < Formula | |
desc "Cryptography and SSL/TLS Toolkit" | |
homepage "https://openssl.org/" | |
url "https://www.openssl.org/source/openssl-1.1.1q.tar.gz" | |
mirror "https://www.mirrorservice.org/sites/ftp.openssl.org/source/openssl-1.1.1q.tar.gz" | |
mirror "http://www.mirrorservice.org/sites/ftp.openssl.org/source/openssl-1.1.1q.tar.gz" | |
mirror "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1q.tar.gz" | |
mirror "https://www.mirrorservice.org/sites/ftp.openssl.org/source/old/1.1.1/openssl-1.1.1q.tar.gz" | |
mirror "http://www.mirrorservice.org/sites/ftp.openssl.org/source/old/1.1.1/openssl-1.1.1q.tar.gz" | |
sha256 "d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as crypto from 'crypto'; | |
function encryptToken(token: string, password: string): string { | |
const iv = crypto.randomBytes(16); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(password), iv); | |
let encrypted = cipher.update(token); | |
encrypted = Buffer.concat([encrypted, cipher.final()]); | |
return `${iv.toString('hex')}:${encrypted.toString('hex')}`; | |
} |
OlderNewer