Skip to content

Instantly share code, notes, and snippets.

😴
Dozing off

Rohith Reddy rohith

View GitHub Profile
@rohith
rohith / images.ps1
Last active Mar 25, 2019
Find images & return count & path within child directories recursively
View images.ps1
ls -Exclude node_modules -Recurse -Include *.jpg, *.jpeg, *.tiff, *.gif, *.webp, *.dng, *.mpg, *.mod, *.mmv, *.tod, *.wmv, *.asf, *.avi, *.divx, *.mov, *.m4v, *.3gp, *.3g2, *.mp4, *.m2t, *.m2ts, *.mts, *.mkv | group -Property Directory -NoElement | sort -Property Count -Descending | select Count, Name | ft > .\pics.txt
@rohith
rohith / functions.styl
Last active Apr 21, 2019
Stylus Functions
View functions.styl
random(a, b)
return math(math(0, 'random') * (b - a + 1) + a, 'floor')
media(screen-pixels)
@media (min-width screen-pixels)
{block}
@rohith
rohith / bitbucket-repo-Xfer.js
Created Feb 11, 2019
Transfer the ownership of multiple bitbucket repos using Puppeteer browser automation
View bitbucket-repo-Xfer.js
const puppeteer = require("puppeteer-core");
const currentOwnerUsername = "", currentOwnerPassword = "", transferToOwnerUsername = "",
loginUrl = "https://bitbucket.org/account/signin/", chromePath = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe";
// list of repos to change ownership for
const repos = [
"https://bitbucket.org/{username}/{repo-name}"
];
@rohith
rohith / run.ps1
Created Feb 4, 2019
Setup Docker to run samba to share persistant volume as a shared drive on windows
View run.ps1
docker run --rm -itd -v "godrive:/godrive" --name samba --net=host -e USERID=0 -e GROUPID=0 dperson/samba -s "godrive;/godrive;yes;no;yes;all"
@rohith
rohith / Proxy.cs
Last active Jan 10, 2019
Generic Service Util Client Proxy to consume WCF services
View Proxy.cs
using System;
using System.ServiceModel;
public class Proxy<T>
{
public ChannelFactory<T> Factory { get; set; }
public Proxy()
{
Factory = new ChannelFactory<T>("endpoint");
@rohith
rohith / PS Profile SymLink.ps1
Created Dec 27, 2018
Create PowerShell profile SymLink from git repo
View PS Profile SymLink.ps1
@rohith
rohith / Pod Mem Usage.ps1
Last active Dec 6, 2018
Simplest way to debug why a pod got OOMKilled with exit code 137
View Pod Mem Usage.ps1
kubectl exec name-of-the-pod -- dmesg > C:\Path\To\Dump\File.txt
@rohith
rohith / PowerShell Profile.ps1
Last active Dec 5, 2018
My custom PS Profile
View PowerShell Profile.ps1
function prompt {
"PS $(pwd;[Environment]::NewLine){0_0} >"
}
@rohith
rohith / Decode Kubernetes Secrets.ps1
Created Nov 22, 2018
Decode kubectl secrets in PowerShell
View Decode Kubernetes Secrets.ps1
kubectl get secrets -o json | ConvertFrom-Json | select -ExpandProperty items | ? data | select -ExpandProperty data | % { $_.PSObject.Properties | % { $_.Name + [System.Environment]::NewLine + [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_.Value)) + [System.Environment]::NewLine + [System.Environment]::NewLine } }
@rohith
rohith / IgnoreSSLCertificate.cs
Created Oct 25, 2018
Ignore SSL certificate check in a WCF service for .NET Framework & dotnet core
View IgnoreSSLCertificate.cs
// For dotnet core
// Put this inside the Proxy client constructor
this.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new System.ServiceModel.Security.X509ServiceCertificateAuthentication()
{
CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None,
RevocationMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck
};
// For .NET Framework
// Place this anywhere in the program so that it's run before initializing the Proxy client
You can’t perform that action at this time.