Skip to content

Instantly share code, notes, and snippets.

View jonathanmorley's full-sized avatar

Jonathan Morley jonathanmorley

View GitHub Profile
@jonathanmorley
jonathanmorley / regex_golf.md
Last active November 16, 2022 17:42 — forked from jpsim/answers.md
Best possible answers collected so far for [Regex golf](http://regex.alf.nu/). === WARNING: SPOILERS ===

Engineering practices

  • Do you use version control? (if not, the interview should be over =))
  • Do you test your code?
  • How do you make sure that all code is understood by more than one person?
  • Do you do code review? Does all code get reviewed?
  • Do you have an issue tracker?
  • Describe your deployment process -- how do you find bugs in your team's code? What recourse do you have when you find a serious bug in production code?
  • Who is responsible for doing deployment? How often do you deploy?
  • How do you think about code correctness?
  • When something goes wrong, how do you handle it? Do devs get shamed for breaking the build?

1. SYSTEM

$ uname –a                          # Display linux system information
$ uname –r                          # Display kernel release information (refer uname command in detail)
$ hostname                          # Show system host name
$ hostname -i                       # Display the IP address of the host (all options hostname)
$ uptime                            # Show how long system running + load (learn uptime command)
$ last reboot                       # Show system reboot history (more examples last command)
$ cat /etc/redhat_release           # Show which version of redhat installed 

$ date # Show the current date and time (options of date command)

@jonathanmorley
jonathanmorley / keybase.md
Created December 23, 2014 20:39
keybase.md

Keybase proof

I hereby claim:

  • I am jonathanmorley on github.
  • I am jonmorley (https://keybase.io/jonmorley) on keybase.
  • I have a public key whose fingerprint is 78B5 5AA7 D8DF 2DD1 F113 5BEF 18E1 4BEA D14A 5636

To claim this, I am signing this object:

@jonathanmorley
jonathanmorley / PS.rb
Created April 7, 2016 20:15
Powershell REPL for windows kitchen machines over WinRM
require 'highline/import'
require 'winrm'
endpoint = 'http://localhost:5985/wsman'
winrm = WinRM::WinRMWebService.new(endpoint, :negotiate, user: 'vagrant', pass: 'vagrant')
winrm.create_executor do |executor|
loop do
executor.run_powershell_script(ask "PS ...> ") do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
$log = "C:\winrm.log"
$http_port = 5985
$https_port = 5986
$appid = '{afebb9ad-9b97-4a91-9ab5-daf4d59122f6}'
"winrm_setup started" | tee $log
# Does everything required for WinRM over HTTP. It also starts and enables the WinRM service
"Using quickconfig to setup WinRM over HTTP" | tee -Append $log
&winrm quickconfig -quiet
@jonathanmorley
jonathanmorley / post-install.bat
Last active September 19, 2019 15:09 — forked from anonymous/post-install.bat
Remove system apps from windows
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
sc config DiagTrack start= disabled
sc config diagnosticshub.standardcollector.service start= disabled
sc config dmwappushservice start= disabled