Skip to content

Instantly share code, notes, and snippets.

View gpsarkar's full-sized avatar
💭
🚀

Ganapati Sarkar gpsarkar

💭
🚀
View GitHub Profile
@gpsarkar
gpsarkar / setup-git-repo-on-onedrive.txt
Last active October 12, 2025 03:39
Setup git repo on onedrive.
Go to onedrive folder in your pc and create a folder for git repository.
Usually onedrive resides in `C:\Users\%username%\OneDrive`
Open GitBash
cd ~/OneDrive
mkdir git
cd git
mkdir myproject
cd myproject
@gpsarkar
gpsarkar / run-ie11-on-jenkins-local-acocunt-testcafe.txt
Last active April 30, 2018 13:44
Run IE11 on Jenkins as Local Account with testcafe
download PsExec from this URL : https://technet.microsoft.com/en-us/sysinternals/bb897553
execute this command : psexec -s -i “%programfiles%\Internet Explorer\iexplore.exe”
IE will open
make IE happy
close it
never touch it again
https://rostacik.net/2017/06/12/my-karma-tests-are-failing-in-ie-on-my-jenkins-and-i-dont-know-why/
@gpsarkar
gpsarkar / cleanup.bat
Created April 25, 2018 06:01
junk cleanup windows
cd C:\Users\%username%\AppData\Local
rmdir /S /Q Temp
del C:\Windows\Prefetch\*.* /Q
del C:\Windows\Temp\*.* /Q
del C:\Users\%username%\AppData\Local\VSEQT\QTAgent\*.* /Q
del C:\Users\%username%\AppData\Local\VSEQT\QTController\*.* /Q
@gpsarkar
gpsarkar / tsung-commands.txt
Created April 25, 2018 05:58
Tsung Commands
Run Tsung
--------------------------------
tsung -f /root/tsung-scenarios/basic2.xml -l /root/tsung-scenarios/log/ start
tsung-recorder record_tag "<transaction name='groups'>"
plot
--------------------------------
/usr/lib/tsung/bin/tsung_stats.pl
/usr/local/lib/tsung/bin/tsung_stats.pl
@gpsarkar
gpsarkar / testcafe_read_file_and_assert_it_contains_text.js
Last active April 18, 2018 13:53
testcafe snippet for asserting a text contains in pptx file
import { Selector } from 'testcafe';
var textract = require('textract');
fixture `File read and assert`
.page(about:blank);
test('test file content', async t => {
const fullFilePath = 'c:\\temp\\test.pptx';
const stringToSearch = 'ABCDXYZ1234';
@gpsarkar
gpsarkar / powershell to rename string in files recursive
Created February 9, 2018 10:19
powershell to rename string in files recursive
Get-ChildItem -r -Depth 1 -include "web.config" |
foreach-object { $a = $_.fullname; ( get-content $a ) |
foreach-object { $_ -replace "oldstring","newstring" } |
set-content $a }
@gpsarkar
gpsarkar / gist:0c4c97cd65c28b53f683854ffae7b16a
Created December 29, 2017 12:49
Install VS Code on CentOS
// RHEL, Fedora and CentOS based distributions
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
sudo yum install code
$webhook = "SLACK INCOMING WEBHOOK URL"
$attachments = @(@{
"pretext" = "Lab 7 Smoke Test"
"color"="danger"
"text"= "14/43 failed (5 mins)"
})
$payload =
@{
"attachments" = $attachments
@gpsarkar
gpsarkar / YahooDataGrabber.py
Created July 16, 2017 21:28
Simple scripts to bulk download historical data from Yahoo! Finance
#!/usr/bin/env python
import csv
import Queue
import threading
import ystockquote as ys
def gen_info_list(tickers, start, end):
'''
@gpsarkar
gpsarkar / Technical Indicators without TA-lib.py
Created July 16, 2017 18:56 — forked from kevincdurand1/Technical Indicators without TA-lib.py
Technical Indicators without TA-lib #tags: Technical Indicators, Quant
import numpy
import pandas as pd
import math as m
#Moving Average
def MA(df, n):
MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n))
df = df.join(MA)
return df