Skip to content

Instantly share code, notes, and snippets.

View hvardhanx's full-sized avatar
🦄
Whattttttt up!?

Harsh Vardhan hvardhanx

🦄
Whattttttt up!?
View GitHub Profile
import re
import httplib
import urllib, urllib2, cookielib
def solve(n):
sum = 0
i = 0
num = 2
while i < n:
f = 0
@hvardhanx
hvardhanx / keybase.md
Last active August 27, 2016 01:54
Keybase

Keybase proof

I hereby claim:

  • I am royalharsh on github.
  • I am hvardhan (https://keybase.io/hvardhan) on keybase.
  • I have a public key ASDHOwAKshtXtPLuoKhcDUwthve4Ilj-S8WqIMAiK5Qghwo

To claim this, I am signing this object:

@hvardhanx
hvardhanx / fingerprints
Created October 22, 2016 11:06
Extend ssh fingerprints to include DSA
/* https://www.shodan.io/host/128.104.222.95 */
~/ssh_scan (master ✔) ᐅ ./bin/ssh_scan --suppress-update-status -t 128.104.222.95
I, [2016-10-22T16:32:56.293495 #31222] INFO -- : Started ssh_scan of 128.104.222.95
I, [2016-10-22T16:33:05.999246 #31222] INFO -- : Completed ssh_scan of 128.104.222.95
[
{
"ssh_scan_version": "0.0.15",
"ip": "128.104.222.95",
"port": 22,
"server_banner": "SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8",
@hvardhanx
hvardhanx / android_permissions.java
Created November 1, 2016 02:56
Android Permissions for API >= 23
// Request the permissions you need:
// Here, thisActivity is the current activity
if (ContextCompat.checkSelfPermission(thisActivity,
Manifest.permission.READ_CONTACTS)
!= PackageManager.PERMISSION_GRANTED) {
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
Manifest.permission.READ_CONTACTS)) {
def initialize(opts = {})
@db_type = if !opts || opts.empty?
'sqlite'
else
opts['database']['type']
end
set_database
end
def self.from_config_file
@hvardhanx
hvardhanx / testing.rb
Created January 17, 2017 07:51
DSA Testing
def test_dsa
p = 718821195410015244146859624870715296017125527913000
434010387577240100831644441209194543573159763837454
2374929457672178957081124632837356913990200866056699
q = 957032439192465935099784319494405376402293318491
g = 122928973717064636255205666162891733518376475981809
749897454444301389338825906076467196186192907631719
698166056821519884939865041993585844526937010746285
y = 123575618358346541478907331350272705707564117251418
193873117202182514955196002970859605710210406339506
@hvardhanx
hvardhanx / surpassing.hs
Last active September 11, 2017 14:03
A surpassing problem
module Surpassing where
import Control.Monad
import Data.List
import Data.Char
import Language.Haskell.Liquid.ProofCombinators
{-@ type NonEmpty a = {v: [a] | 0 < len v} @-}
{-@ msc :: Ord a => NonEmpty a -> Int @-}
@hvardhanx
hvardhanx / 70-synaptics.conf
Last active July 30, 2017 13:30
Synaptics touchpad config
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
@hvardhanx
hvardhanx / .i3_config
Last active August 12, 2018 00:45
Manjaro: i3 config
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4
# set default desktop layout (default is tiling)
# workspace_layout tabbed <stacking|tabbed>
# Configure border style <normal|1pixel|pixel xx|none|pixel>
[bar/top]
width = 100%
height = 24
monitor = ${env:MONITOR:eDP1}
background = #141021
foreground = #D6DAC2
fixed-center = true