Skip to content

Instantly share code, notes, and snippets.

@techierishi
techierishi / SqlBackupToS3.ps1
Created March 19, 2020 15:12 — forked from martic/SqlBackupToS3.ps1
Powershell Sql Backup To AWS S3
# Needed PS packages
# Install-Package -Name pscx
# Install-Package -Name AWSPowerShell
#
# Scheduling
# The script then needs to be scheduled to run every night, I’m using scheduled tasks for this,
# creating a task that runs nightly and triggers the powershell script by running
# Powershell.exe with the arguments 
# -ExecutionPolicy Bypass C:\SqlBackup\SqlBackupToS3.ps1.
# From <https://www.rhysgodfrey.co.uk/b/blog/posts/backing-up-a-sql-database-to-amazon-s3-using-powershell>
@techierishi
techierishi / install_chrome_win.ps
Created December 23, 2019 15:27
Install chrome using powershell. Avoid Internet Explorer altogether :)
$Installer = "$env:temp\chrome_installer.exe"
$url = 'http://dl.google.com/chrome/install/375.126/chrome_installer.exe'
Invoke-WebRequest -Uri $url -OutFile $Installer -UseBasicParsing
Start-Process -FilePath $Installer -Args '/silent /install' -Wait
Remove-Item -Path $Installer
@techierishi
techierishi / unsubscribe.youtube.js
Created September 24, 2019 17:57
De-Cluttter youtube subscription. UN-SUBSCRIBE ALL
// Go to subscribers list page.
// Scroll down many times till all subscription appears.
// Now open Dev-Tools and run following JS in console.
Array.from(document.querySelectorAll("#subscribe > ytd-subscribe-button-renderer > paper-button > yt-formatted-string")).forEach((_item,index)=>{
(function(__item){
const timeWait = 1000*index;
setTimeout(()=> {
console.log("timeWait",timeWait)
console.log("Unsubscribing",_item.parentComponent.parentComponent.querySelector("#title").innerText);
sudo mount -t vboxsf VMShared /sharedvol
@techierishi
techierishi / Dockerfile
Created June 27, 2019 08:32
Frontend Docker
FROM nginx:1.14.1-alpine
## Copy our default nginx config
COPY ./nginx/default.conf /etc/nginx/conf.d/
## Copy dist folder to nginx static dir
COPY ./dist/chatbot-ui /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
@techierishi
techierishi / JenkinsDockerfile
Last active June 27, 2019 08:05
JenkinsDockerCompose
FROM jenkins/jenkins:lts-alpine
USER root
RUN apk add --update ca-certificates && rm -rf /var/cache/apk/* && \
find /usr/share/ca-certificates/mozilla/ -name "*.crt" -exec keytool -import -trustcacerts \
-keystore /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/cacerts -storepass changeit -noprompt \
-file {} -alias {} \; && \
keytool -list -keystore /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/cacerts --storepass changeit
ENV MAVEN_VERSION 3.5.4
#!/bin/bash
#installing docker and docker compose
export DEBIAN_FRONTEND=noninteractive
yes | sudo apt update
sudo apt-get upgrade -yq
yes | sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
yes | sudo apt-get update
<!DOCTYPE html>
<html>
<head>
<title>Dataset Download</title>
<link href="css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="js/download.js"></script>
<!-- https://bootsnipp.com/snippets/GavAo -->
<style type="text/css">
#logreg-forms{
var count = 0;
setInterval(() => {
window.scrollTo(0, document.body.scrollHeight);
count += 10;
if (count == 1000) {
document.querySelectorAll('.ProfileTweet-actionButtonUndo').forEach((button) => {
button.click();
});
// <Imports>
var http = require("http");
// </Imports>
var API_URL="numbersapi.com";
// <UtilityFunctions>
const getIdx = () => {
const max = 3;
const min = 1;