Instantly share code, notes, and snippets.

🎯
Focusing

Rohith Reddy Kumbharkar rohith

View GitHub Profile
View functions.styl
random(a, b)
return math(math(0, 'random') * (b - a + 1) + a, 'floor')
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}"
];
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"
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");
View PS Profile SymLink.ps1
View Pod Mem Usage.ps1
kubectl exec name-of-the-pod -- dmesg > C:\Path\To\Dump\File.txt
View PowerShell Profile.ps1
function prompt {
"PS $(pwd;[Environment]::NewLine){0_0} >"
}
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 } }
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
View vs code settings.json
{
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"files.autoSave": "onFocusChange",
"editor.formatOnType": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,