Skip to content

Instantly share code, notes, and snippets.

View regme's full-sized avatar
🤠

Andrey Katamanov regme

🤠
View GitHub Profile
Test-NetConnection -ComputerName 10.31.2.11 -Port 1433
docker run --rm -it -v C:\Install\JetBrains:/load python:2.7.15 bash
cd load/
wget https://download.jetbrains.com/go/goland-2019.1.3.exe
@regme
regme / pyodbc-unixODBC-lambda-layer
Created May 2, 2019 12:40 — forked from diriver63/pyodbc-unixODBC-lambda-layer
pyodbc and unixODBC for MSSQL as a lambda layer
# use https://github.com/lambci/docker-lambda to simulate a lambda environment
docker run -it --rm --entrypoint bash -e ODBCINI=/opt/odbc.ini -e ODBCSYSINI=/opt/ lambci/lambda:build-python3.7
# download and install unixODBC
# http://www.unixodbc.org/download.html
curl ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz -O
tar xzvf unixODBC-2.3.7.tar.gz
cd unixODBC-2.3.7
./configure --sysconfdir=/opt --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE --prefix=/opt
select ind.NewsHeadlinesIndicatorId, ind.Title, ii.cnt from NewsHeadlinesIndicator ind
join (
select NewsHeadlinesindicatorId, count(*) as cnt from (
SELECT [NewsHeadlinesIndicatorId]
,[FundId]
,[EventDTM]
,[NewsHeadlinesZoneId]
,[Trend]
,[OccurrencesTotal]
,[OccurrencesChecked]
@regme
regme / gist:7e0115a8e13ca90d8a85af96f2d4d367
Last active March 12, 2019 14:40
SQL: Islands and Gaps
drop table #overlappingDateRages
create table #overlappingDateRages(
StartDate date,
EndDate date
)
insert into #overlappingDateRages(StartDate, EndDate)
select '8/24/2017' StartDate , '9/23/2017' EndDate union all
select '8/24/2017' , '9/20/2017' union all
http://www.homedev.com.au/Free/PatchCleaner
@regme
regme / docker-rm-images.md
Created February 28, 2019 21:11 — forked from alferov/docker-rm-images.md
Remove all (untagged) images and containers from Docker
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")

References:

c:\windows\system32\inetsrv\AppCmd.exe set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/json',enabled='True']" /commit:apphost
c:\windows\system32\inetsrv\AppCmd.exe set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/json; charset=utf-8',enabled='True']" /commit:apphost
c:\windows\system32\inetsrv\AppCmd.exe set config -section:system.webServer/httpCompression /+"staticTypes.[mimeType='image/*',enabled='True']" /commit:apphost
diskspd.exe -c1G -b4K -t2 -d10 -a0,1 testfile1.dat testfile2.dat
diskspd.exe -b4k -d30 -o32 -h -L -t8 -W -w50 -P1000 testfile1.dat testfile2.dat
@regme
regme / gist:94c5554dcfcca99e3690edfa87671c2b
Last active September 28, 2018 12:28
drop all tags from git except 100 last
git tag | grep -E "^[[:alpha:]]" | xargs -n 1 git push --delete origin & git tag | grep -E "^[[:alpha:]]" | xargs git tag -d
git tag | head -n -100 | xargs -n 1 git push --delete origin & git tag | head -n -100 | xargs git tag -d
git fetch --prune origin "+refs/tags/*:refs/tags/*"