Skip to content

Instantly share code, notes, and snippets.


Sadi Kaya sadikaya

View GitHub Profile
View Prevent Cisco AnyConnect from disconnecting when locking screen on


Launch Terminal and run:

ifconfig | grep -B 6 'status: active' | head -n 1 | cut -d : -f 1

Then run (replace en0 below with the output of the command above):

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO
sadikaya /
Created July 17, 2018 07:09 — forked from swalkinshaw/
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

sadikaya /
Last active January 6, 2022 08:27 — forked from AlexZeitler/
DigitalOcean snippets
sudo apt-get update
sudo apt-get install nginx
# default website
sadikaya / deploy.js
Created March 12, 2018 11:38 — forked from maciejkorsan/deploy.js
deploy.js script for CircleCI GitHub - FTP upload
View deploy.js
var FtpDeploy = require('ftp-deploy');
var ftpDeploy = new FtpDeploy();
var config = {
username: process.env.FTPUSERNAME,
password: process.env.FTPPASS,
host: process.env.FTPHOST,
port: 21,
localRoot: __dirname + "/../dist/",
remoteRoot: "/",
sadikaya / PowerShell
Created January 8, 2018 13:24 — forked from jchandra74/PowerShell
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization
View PowerShell

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

sadikaya /
Created November 27, 2017 08:56
Converting a PFX file to PEM and Key via openssl

Export the private key

openssl pkcs12 -in certificate.pfx -out certificate.key -nocerts -nodes

Take out the encryption from the private key

openssl rsa -in certificate.key -out certificate_new.key
sadikaya / Howto convert a PFX to a seperate .key & .crt file
Created November 27, 2017 07:56 — 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
View 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]`
sadikaya /
Created September 12, 2017 11:18 — forked from christianc1/
SFTP Deploys for Pressed with Circle CI

Simple SFTP Deploy when better methods are unavailable by host


  • npm install --save-dev ftps
  • Add deploy.js to theme/plugin root
  • Add deploy.config.js to theme/plugin root
  • Modify config.


  • Set up Circle CI with SFTP_HOST SFTP_PASS SFTP_USER environmental variables
sadikaya /
Created June 12, 2017 11:16
Rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
sadikaya /
Created December 15, 2016 06:03
react component lifecycles

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
  • componentDidUpdate (Update only)