Skip to content

Instantly share code, notes, and snippets.

@DerfOh
DerfOh / Bank Accounts
Created January 19, 2014 17:14
A helpful programming assignment
+ CSC/CIS 276
+ Problem Solving and Programming II in Java
+ Assignment 1 due Jan 29, 2014 – 6%
+
+
+
+
+Objective of this Assignment:
+This is your first Java programming assignment. The purpose is to synthesize the introductory
+object-oriented programming concepts in Chapters 1 to 5 that include the C++ concepts learned
@DerfOh
DerfOh / parsejson
Created December 14, 2016 19:41
simple example of using awk to parse a json output
echo "$status" | awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/completed\042/){print $(i+1)} } }'
@DerfOh
DerfOh / cygwin-colors-email.md
Last active December 21, 2016 17:42
Changing cygwin colors

ls --color scheme

From: "Robert Mark Bram"

To: "Cygwin"

Date: Wed, 12 Jun 2002 02:44:32 +1000

Subject: ls --color scheme

Howdy all!

For the record, this is what I have found out about changing ls color scheme.

@DerfOh
DerfOh / dos2unix-recursive.md
Last active December 21, 2016 18:09
convert all files in a dir to unix using dos2unix

Convert all files in a directory to Unix format

  1. Set up dos2unix

  2. Run the following in the directory

find . -type f -exec dos2unix {} \;
@DerfOh
DerfOh / change script execution.md
Created December 21, 2016 20:49
change execution mode of a shell script that is written on windows
git update-index --chmod=+x foo.sh

git ls-files --stage
@DerfOh
DerfOh / .vimrc
Created December 23, 2016 13:41
my .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=/cygdrive/c/Users/fpaulin/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@DerfOh
DerfOh / cygwin-arrow-key-fix.md
Created December 23, 2016 19:44
cygwin change ctrl+arrow to normal mvmt behavior

Add the following lines to ~/.inputrc (C:\cygwin\home<username>.inputrc):

"\e[1;5C": forward-word   # ctrl + right
"\e[1;5D": backward-word  # ctrl + left 
@DerfOh
DerfOh / add-keys.md
Last active January 2, 2017 06:32
Add SSH Keys to server

How to add your ssh keys in one line

cat ~/.ssh/id_rsa.pub | ssh user@hostname "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"
@DerfOh
DerfOh / ssl-date-check.md
Created January 13, 2017 14:53
How to check the SSL cert expiration date using command

How to check the SSL cert expiration date using command

echo | openssl s_client -connect www.google.com:443 2>/dev/null | openssl x509 -noout -dates

Keybase proof

I hereby claim:

  • I am derfoh on github.
  • I am derfoh (https://keybase.io/derfoh) on keybase.
  • I have a public key whose fingerprint is 455B 12C4 3464 76B8 9808 2F98 363F 303C B42E BBBC

To claim this, I am signing this object: