Skip to content

Instantly share code, notes, and snippets.

View mohnish82's full-sized avatar

Mohnish Chaudhary mohnish82

View GitHub Profile
@mohnish82
mohnish82 / DeleteGoogleVoiceCallLog.html
Created November 8, 2012 03:46
Selenium script to recursively delete google voice call log
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head profile=”http://selenium-ide.openqa.org/profiles/test-case”>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
<link rel=”selenium.base” href=”https://www.google.com/” />
<title>gv_del</title>
</head>
<body>
<table cellpadding=”1″ cellspacing=”1″ border=”1″>
@mohnish82
mohnish82 / Program.cs
Last active November 21, 2023 20:10
Digital signature verification - CSharp and Java
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace DigitalSigning
{
@mohnish82
mohnish82 / gist:0525b7a9d4c5fbf6f346
Created February 18, 2015 23:11 — forked from nicholashagen/gist:5306330
HDHomeRun Config command line

Download Source

#> wget http://download.silicondust.com/hdhomerun/libhdhomerun_20130117.tgz
#> tar zxvf libhdhomerun_20130117.tgz 

Install Tools

@mohnish82
mohnish82 / prename.pl
Last active October 21, 2015 04:05 — forked from javiermon/prename.pl
`prename` script from Debian's 'perl' package
#!/usr/bin/perl -w
#
# This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
# from Larry Wall's original script eg/rename from the perl source.
#
# This script is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
Log events to file
==================
curl -H 'Authorization: Bearer <auth_token_here>' -N https://api.particle.io/v1/devices/events -o photon.log
-H => header
-N => No buffer; output in real time
-o => output to file
@mohnish82
mohnish82 / random.txt
Last active March 31, 2016 02:18
Random number generator commandfu
# Method 1
cat /dev/random | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 5
tr => translate/delete input stream
-d => delete from stream
-c => complement of SET1, SET1 being 'a-zA-Z0-9' i.e. delete all chars except the ones in SET1 from input stream
fold => wrap output into 16 column fixed width i.e. generate passwords of length 8
head => top 5 results only
@mohnish82
mohnish82 / keybase.md
Created September 28, 2017 03:55
Keybase proof

Keybase proof

I hereby claim:

  • I am mohnish82 on github.
  • I am mohnish82 (https://keybase.io/mohnish82) on keybase.
  • I have a public key ASA1RN9bNoXuadvUq765ZjY1QbQ3aEuKH5beqw7RZ1KSlgo

To claim this, I am signing this object:

@mohnish82
mohnish82 / test.txt
Created October 4, 2018 12:07
Markdown file
Hello
![Some Text](static/images/image.png)
World
@mohnish82
mohnish82 / FileMimeTypeService.java
Created May 31, 2019 17:51
[Java] Mime type detection
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
public class FileMimeTypeService {
public String getContentType(String file) {
@mohnish82
mohnish82 / application.yml
Created April 13, 2020 17:41
Spring Boot Keycloak OpenID Connect config
spring:
security:
oauth2:
client:
registration:
keycloak:
client-id: xyz-app
client-secret: <insert-secret-here>
clientName: XYZ
authorization-grant-type: authorization_code