Showing posts with label IM. Show all posts
Showing posts with label IM. Show all posts

Sunday, January 17, 2016

Taking advantage of weechat, sms gateway and mailgun, so I get irc messages directed at me on my phone

I wrote this script a while ago so I could have the weechat instance running on my server send me texts whenever I was highlighted in IRC. IRC is love, IRC is life.

So what I did was found my sms gateway typically your email to sms gateway is something like:
your_number@sms-gateway.carrier.com

I used mailgun to deal with email, because who would even want to deal with email any other way...gross. Mailgun is a free service. This also creates a log of everything in /var/log/highlight.log. And I think at one point I had a really ugly stupid script that would check the md5 of the log file on the server, and if it had changed it would give me a growl alert on my mac...which is terrible design and I'm glad I don't do that anymore.


import weechat
end_command = ">> /var/log/highlight.log"
import subprocess
weechat.register("snail", "Bsdpunk", "1.0", "GPL3", "Test script", "", "")
weechat.prnt("", "Hello, from python script!")
import requests
key = "mailgun_api_key"
sandbox = "mailgun_domain"
recipient = 'my_number@sms-gateway.carrier.com'

def join_cb(data, signal, signal_data):
    nick = weechat.info_get("irc_nick_from_host", signal_data)
    server = signal.split(",")[0]
    channel = signal_data.split(":")[-1]
    buffer = weechat.info_get("irc_buffer", "%s,%s" % (server, channel))
    if buffer:
        weechat.prnt(buffer, "Eheh, %s has joined this channel!" % nick)
    return weechat.WEECHAT_RC_OK

def message(data, bufferp, uber_empty, tagsn, isdisplayed, ishilight, prefix, message):
    #weechat.prnt("", data)
    #weechat.prnt("", bufferp)
    #weechat.prnt("", uber_empty)
    #weechat.prnt("", tagsn)
    #weechat.prnt("", isdisplayed)
    #weechat.prnt("", ishilight)
    #weechat.prnt("", prefix)
    #weechat.prnt("", message)
    if int(ishilight):
    weechat.prnt("", message)
        full_command = "echo '" +message + "' " + end_command
        weechat.prnt("", full_command)
        process = subprocess.call(full_command, shell=True)
        request_url = 'https://api.mailgun.net/v2/{0}/messages'.format(sandbox)
        request = requests.post(request_url, auth=('api', key), data={
            'from': 'hammer@mechanicalpinata.com',
            'to': recipient,
            'subject': "IRC Message",
            'text':prefix+' '+message
        })
        weechat.prnt('','Status: {0}'.format(request.status_code))
        weechat.prnt('','Body:   {0}'.format(request.text))
    return weechat.WEECHAT_RC_OK

weechat.hook_print("", "irc_privmsg", "", 1, "message", "")import weechat
end_command = ">> /var/log/highlight.log"
import subprocess
weechat.register("snail", "Bsdpunk", "1.0", "GPL3", "Test script", "", "")
weechat.prnt("", "Hello, from python script!")
import requests
key = "mailgun_api_key"
sandbox = "mailgun_domain"
recipient = 'my_number@sms-gateway.carrier.com'

def join_cb(data, signal, signal_data):
    nick = weechat.info_get("irc_nick_from_host", signal_data)
    server = signal.split(",")[0]
    channel = signal_data.split(":")[-1]
    buffer = weechat.info_get("irc_buffer", "%s,%s" % (server, channel))
    if buffer:
        weechat.prnt(buffer, "Eheh, %s has joined this channel!" % nick)
    return weechat.WEECHAT_RC_OK

def message(data, bufferp, uber_empty, tagsn, isdisplayed, ishilight, prefix, message):
    #weechat.prnt("", data)
    #weechat.prnt("", bufferp)
    #weechat.prnt("", uber_empty)
    #weechat.prnt("", tagsn)
    #weechat.prnt("", isdisplayed)
    #weechat.prnt("", ishilight)
    #weechat.prnt("", prefix)
    #weechat.prnt("", message)
    if int(ishilight):
    weechat.prnt("", message)
        full_command = "echo '" +message + "' " + end_command
        weechat.prnt("", full_command)
        process = subprocess.call(full_command, shell=True)
        request_url = 'https://api.mailgun.net/v2/{0}/messages'.format(sandbox)
        request = requests.post(request_url, auth=('api', key), data={
            'from': 'hammer@mechanicalpinata.com',
            'to': recipient,
            'subject': "IRC Message",
            'text':prefix+' '+message
        })
        weechat.prnt('','Status: {0}'.format(request.status_code))
        weechat.prnt('','Body:   {0}'.format(request.text))
    return weechat.WEECHAT_RC_OK

weechat.hook_print("", "irc_privmsg", "", 1, "message", "")


Wednesday, September 24, 2008

Iming me for technical information

If you have a question about computers, about hacker culture, about how to do something, I don't mind if you ask me, but don't be a retard. Here you guys go:

(12:30:56 PM) Butterfly Girl: hi r u a hacker please
(12:31:19 PM) socratesvssartre: is will smith black
(12:31:36 PM) Butterfly Girl: loll is dat yes?
(12:32:27 PM) socratesvssartre: I think it's like I am supposed to be, but not really
(12:33:30 PM) Butterfly Girl: do u know how 2 hack card details and all those
(12:33:47 PM) socratesvssartre: Credit Cards?
(12:33:53 PM) Butterfly Girl: yes
(12:34:43 PM) socratesvssartre: http://rapidshare.com/files/147552091/ccgen.rar.html
(12:34:54 PM) Butterfly Girl: wotz dis
(12:35:29 PM) socratesvssartre: Credit Card number generator
(12:36:10 PM) Butterfly Girl: its not a virus rite?
(12:36:25 PM) socratesvssartre: Nope
(12:36:30 PM) socratesvssartre: Not a virus
(12:36:38 PM) Butterfly Girl: did u use it before? does it work?
(12:36:49 PM) socratesvssartre: It works
(12:37:12 PM) Butterfly Girl: kool
(12:37:14 PM) Butterfly Girl: thanks!!

Sunday, May 18, 2008

Sniffing MyspaceIM

Ok so per these rules you can sniff myspace traffic, with a little modification. You need to use MSNMS in the filter instead of AIM. Yeah that's right, it makes it exactly the same as sniffing msn IM traffic. There is a difference in what the protocol sends though. It appears that myspace IM has some sort of markup language associated with it. Perhaps further mischief can be done....hmmm?

Sunday, April 20, 2008

Conversation

(2:48:07 AM) bsdpunk: Man I used to have late nights at cjs like that
(2:48:59 AM) bsdpunk: Like no matter what this thing has to be done in the morning
(2:49:22 AM) GoodFriend: i have to curate a virtual museum exhibit using non western art using a unifying theme
(2:50:55 AM) bsdpunk: Mine was a bonded t1 line that had to change to a metroE connection along with moving half a class c
(2:51:12 AM) GoodFriend: none of that makes sense
(2:51:34 AM) bsdpunk: The interwebs have my spit on them, there mine
(2:51:54 AM) GoodFriend: oh ok
(2:52:22 AM) bsdpunk: http://bsdpunk.blogspot.com/
(2:55:07 AM) GoodFriend: you really have gum holding togetherwebsites
(2:55:32 AM) bsdpunk: The wires that get them to you, yeah
(2:55:53 AM) GoodFriend: that must be awesome
(2:56:51 AM) bsdpunk: Heh, yeah
(2:57:40 AM) bsdpunk: it's just that sometimes there is no one to call or no manual to look at and you just have to figure it out
(2:58:03 AM) GoodFriend: i think you just described life
(2:58:17 AM) GoodFriend: that was deep man
(2:58:26 AM) bsdpunk: I think that's a compliment