Skip to content

Instantly share code, notes, and snippets.

View bora89's full-sized avatar
💭
🧑‍💻 Have you digitised your business❓Tell me if you haven't!

Alexander Borisenko bora89

💭
🧑‍💻 Have you digitised your business❓Tell me if you haven't!
  • Digimation
  • Dubai, United Arab Emirates
View GitHub Profile
@bora89
bora89 / Howto convert a PFX to a seperate .key & .crt file
Created February 11, 2018 17:45 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@bora89
bora89 / git-flow-mac-os.md
Created October 7, 2017 16:58
git flow for MacOS

brew install git-flow-avh

if you have installed old verstion of git flow (git flow version) then:

brew unlink git-flow

brew install git-flow-avh

launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
@bora89
bora89 / kill-the-process-pid.sh
Created September 16, 2017 10:13
kill the process
kill -9 PID
@bora89
bora89 / list-used-port.sh
Created September 16, 2017 10:12
list used port
lsof -i :3000
@bora89
bora89 / vim-indentation.txt
Created August 6, 2017 14:19
vim intedentation
gg=G
This indents the entire file!
And below are some of the simple and elegant commands used to indent lines quickly in Vim or gVim.
To indent the current line
==
To indent the all the lines below the current line
@bora89
bora89 / vim-tmux-clipboard.sh
Created August 6, 2017 07:54
MacOS clipboard for VIM & Tmux
brew install reattach-to-user-namespace
# in .tmux.conf
set-option -g default-command "reattach-to-user-namespace -l zsh"
# restart tmux
tmux kill-server
# in .vimrc
set clipboard=unnamed
@bora89
bora89 / react-pass-props-children.js
Created March 22, 2017 12:41
react pass props to this.props.children
/**
* pass props to this.props.children
* see http://stackoverflow.com/questions/32370994/how-to-pass-props-to-this-props-children
*/
const childrenWithProps = React.Children.map(this.props.children,
(child) => React.cloneElement(child, {
onGo: (value) => {
// invoke child onGo event (if any)
if (child.props.onGo) {
child.props.onGo(value);
@bora89
bora89 / git-remove-branch.sh
Last active May 8, 2017 11:29
Remove remote git branch
# local
git branch -d mybranch
# remote
git push origin :the_remote_branch