Skip to content

Instantly share code, notes, and snippets.

View hj91's full-sized avatar
:octocat:

Harshad Joshi hj91

:octocat:
View GitHub Profile
/*
LinConnect: Mirror Android notifications on Linux Desktop
Copyright (C) 2013 Will Hauck
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@hj91
hj91 / wififail.txt
Created July 9, 2014 14:50
This is the output of my dmesg after i logged in. I disabled wifi and was unable to boot in. After much efforts i managed to enable wifi and this is what i got. Ubuntu is made by bastards. fucking bastards. idiots releasing untested and unstable drivers.
[ 265.138732] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138755] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138778] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138801] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138824] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138846] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138868] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138891] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138913] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
[ 265.138935] ieee80211 phy0: >brcms_c_prec_enq_head: No where to go, prec == 4
@hj91
hj91 / cellinfo2
Created July 25, 2013 13:44
Code for printing Cell Tower information for non GPS phones.
/* @author=harshad joshi */
package com.harshad.cellinfo2;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
@hj91
hj91 / exampleinstance.py
Created June 2, 2013 11:07
a simple example of using isinstance in Python
class A:
def __init__(self,a):
self.a=a
print self.a
def show(self):
print self.a
a=A(1)
a.show()
@hj91
hj91 / text1.py
Last active December 17, 2015 16:18
This gist is an example of opening a file in read only mode, reading its contents and manipulating some standard string functions.
a=open("text1.txt","r")
b=[]
for i in a.readlines():
b.append(i)
if b.__contains__("hello"):
print "Yes"
else:
print "No"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Full script used in blog post at http://h6o6.com/2013/03/using-python-and-the-nltk-to-find-haikus-in-the-public-twitter-stream
4-clause license (original "BSD License")
Copyright (c) 2013, h6o6
All rights reserved.
@hj91
hj91 / lockcap.c
Created February 23, 2013 15:31
generating segfault and logging it in kern.log
/* this code is meant to run on MS DOS machines and uses bios bit setting to turn CAPS LOCK on or off */
/* it contains far keyword, which is not used in gcc */
#include <stdio.h>
void main()
{
char *kb;
kb = (char *)0x417;
*kb = 64;
@hj91
hj91 / gist:4202475
Created December 4, 2012 10:27
How to send mail using exim and command line prompt
user@localhost:~$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Postfix (Ubuntu)
mail from:root@localhost
250 2.1.0 Ok
rcpt to:harshad@localhost
250 2.1.5 Ok
@hj91
hj91 / myrr1.c
Created June 25, 2012 05:18
I found this code on my old computer. It probably logs udp packets. This verion detects a traceroute done from/on your computer
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#ifndef __USE_BSD
#define __USE_BSD
@hj91
hj91 / Gorillas.bas
Created June 25, 2011 17:07
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana