Skip to content

Instantly share code, notes, and snippets.

View ndelitski's full-sized avatar

Nick Delitski ndelitski

  • Lisbon, Portugal
  • 14:26 (UTC -12:00)
View GitHub Profile
# Powershell Script to prepare the windows install to be used with vagrant-windows
Set-ExecutionPolicy -executionpolicy remotesigned -force
# Step 1: Disable UAC
New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -PropertyType DWord -Value 0 -Force | Out-Null
Write-Host "User Access Control (UAC) has been disabled." -ForegroundColor Green
# Step 2: Disable IE ESC
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0 | Out-Null
#Enable RDP
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 0
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
@ndelitski
ndelitski / install-msnodeodbc
Last active August 29, 2015 14:02
Fixed install msbodeodbc script
#!/bin/bash
# Microsoft SQL Server ODBC Driver V1.0 for Linux Installer
# Copyright Microsoft Corp.
# Set to 1 for debugging information/convenience.
debug=0
# Strings listed here
driver_name="Microsoft ODBC Driver 11 for SQL Server";
driver_version="11.0.2270.0"
@ndelitski
ndelitski / sql-odbc.sh
Last active August 29, 2015 14:02
Install odbc drivers working properly with MS SQL Server
#!/bin/bash
set -e
pwd=`pwd`
cd /usr/local/src
#install unixodbc
wget http://onefinepub.com/wp-content/uploads/2014/03/unixodbc_2.3.2-1_amd64.deb
dpkg -i unixodbc_2.3.2-1_amd64.deb

Tasks

Get task

GET /api/tasks/:id

Get task tree

GET /api/tasks/:id/tree

Response:

{
@ndelitski
ndelitski / request.sh
Created October 9, 2015 11:01 — forked from nuxlli/unix_socket_request.sh
Examples of http request (in unix domain socket) with bash and [nc|socat]
#!/bin/bash
# References
# http://www.computerhope.com/unix/nc.htm#03
# https://github.com/daniloegea/netcat
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
# http://www.dest-unreach.org/socat/
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES
sudo echo deb https://apt.dockerproject.org/repo ubuntu-`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d'=' -f2` main >> /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D
sudo apt-get update -y
sudo apt-get install docker-engine -y
@ndelitski
ndelitski / test-port.sh
Created October 10, 2015 22:57
test port on the host Will output 0 if port 123 is open, and 1 if it's closed.
nc 127.0.0.1 123 < /dev/null; echo $?
@ndelitski
ndelitski / fs.sh
Created October 11, 2015 00:20
console snippets
# print current directory tree
find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
@ndelitski
ndelitski / docker-snippets.sh
Created October 11, 2015 10:40
docker snippets
#clean all exited images
docker ps -a | grep 'Exited' | awk '{print $1}' | xargs -n1 docker rm