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
# https://habrahabr.ru/post/331348/ | |
# https://habrahabr.ru/post/122445/ | |
# open local port on remote machine | |
ssh -R 9000:localhost:9000 remoteHost | |
# open remote port on local machine | |
ssh -L 9000:localhost:9000 remoteHost |
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
#!/bin/bash | |
echo | openssl s_client -servername server.com -connect server.com:443 2>/dev/null | openssl x509 -noout -dates |
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
#!/bin/bash | |
# Useage: | |
# $ git_day_log 2017-03-30 | |
git log --all --after="$1 00:00:00" --before="$1 23:59:59" --author="Sokil" |
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
#!/bin/bash | |
# https://curl.haxx.se/docs/manpage.html | |
# time_appconnect The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0) | |
# time_connect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed. | |
# time_namelookup The time, in seconds, it took from the start until the name resolving was completed. | |
# time_pretransfer The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. | |
# time_redirect The time, in seconds, it took for all redirection steps including name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections. (Added in 7.12.3) | |
# time_starttransfer The time, in seconds, it took from the start until the first byte was j |
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
#!/bin/bash | |
mysql_config_file="~/connection.cfg"; | |
startOffset=$1; | |
endOffset=$2; | |
chunkSize=$3; | |
for ((i=$startOffset; i<=$endOffset; i=$i+$chunkSize)); | |
do | |
values=""; |
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 MyClass { | |
public: | |
MyClass(int a) : var(a) | |
{ } | |
void printInfo() { | |
cout << var<<endl; | |
cout << this->var<<endl; | |
cout << (*this).var<<endl; | |
} | |
private: |
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
<?php | |
function renderListByColumns(array $list, $columnCount = 4, $columnSize = 50) | |
{ | |
sort($list); | |
$size = count($list); | |
$rowSize = ceil($size / $columnCount); | |
// pad types array |
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
BEGIN:VCALENDAR | |
VERSION:1.0 | |
BEGIN:VEVENT | |
TZID:Europe/Kiev | |
DTSTART:20170121T110000 | |
DTEND:20170121T130000 | |
LOCATION:Київ, вул. Хрещатик, 36 | |
DESCRIPTION:Форум громадських проектів міста Києва. Ярмарок громадських проектів 2.0. | |
SUMMARY:Форум громадських проектів міста Києва. | |
ORGANIZER;CN=Kyiv Smart City:MAILTO:[email protected] |
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
#!/bin/bash | |
# get all files | |
find . -type f | sort | xargs -I{} bash -c 'echo ${1:2}' -- {} | |
# get tracked git files | |
git ls-files | sort | |
# ignored git files | |
git status --ignored . |
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
#!/bin/bash | |
FILE=$(readlink -f $0); | |
DIR=$(dirname $FILE) | |
echo $FILE | |
echo $dir |