Skip to content

Instantly share code, notes, and snippets.

/**
* APNS test client
*/
var net = require('net');
var HOST = '127.0.0.1';
var PORT = 7777;
var TOKEN_LENGTH = 64;
var NUM_PACKETS = 5;
/**
* Mock APNS server
*/
var net = require('net');
var HOST='127.0.0.1';
var PORT=7777;
// Need this option so the client doesn't close
// the connection on sending a FIN
@varvaruc
varvaruc / apns.py
Created March 20, 2014 19:17 — forked from fermion/apns.py
import socket, ssl, json, struct
import binascii
# device token returned when the iPhone application
# registers to receive alerts
deviceToken = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62'
thePayLoad = {
'aps': {
'alert':'Oh no! Server\'s Down!',
@varvaruc
varvaruc / boost-windows.md
Created December 17, 2018 15:00 — forked from sim642/boost-windows.md
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for GCC (MinGW) on Windows

Folder setup

  1. Extract downloaded boost source, e.g. C:\Program Files\boost_1_59_0.
  2. Create a folder for Boost.Build installation, e.g. C:\Program Files\boost-build.
  3. Create a folder within for building, i.e. C:\Program Files\boost_1_59_0\build.
  4. Create a folder for installation, e.g. C:\Program Files\boost.

GCC setup

  1. Open Command Prompt.
#!/usr/bin/env python
#
# Copyright 2014-2015 Cameron Hart <[email protected]>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@varvaruc
varvaruc / Webcam-Motion-setup-ubuntu.md
Last active March 14, 2020 08:33 — forked from endolith/readme.md
How to stream a webcam to a web browser in Ubuntu

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion

~> nano ~/.motion/motion.conf

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@varvaruc
varvaruc / _readme.txt
Created April 3, 2020 14:11 — forked from jcward/_readme.txt
A Perl-regex based copy script, derived from the rename script
I really like the regex syntax of the rename perl script, e.g.:
rename "s/OldFile/NewFile/" OldFile*
I simply wanted the same thing with a copy command:
copy "s/OldFile/NewFile/" OldFile*
So here it is!
@varvaruc
varvaruc / Regpx.h
Created April 22, 2020 10:09 — forked from Solution/Regpx.h
My C version of preg_match()
/*
* File: Regxp.h
* Author: solution
*
* Created on 11. listopad 2011, 16:00
*/
#include <stdio.h>
#include <string.h>
#include <pcre.h>
@varvaruc
varvaruc / IPTV-big-list.m3u
Created July 12, 2021 09:03 — forked from jonathanhammond/IPTV-big-list.m3u
IPTV big list.m3u
#EXTM3U
#EXTINF:0 tvg-name="Newsmax TV" tvg-language="English" tvg-country="CA" tvg-id="Newsmax-TV" tvg-logo="https://i.imgur.com/Twkovic.gif" group-title="Entertainment",Newsmax TV
https://nmxlive.akamaized.net/hls/live/529965/Live_1/index.m3u8
#EXTINF:0 tvg-logo="https://i.imgur.com/ODIWC6n.jpg" tvg-name="Infowars1" tvg-id="Infowars1" group-title="News",Infowars Live1
https://infostream.secure.footprint.net/hls-live/infostream-infostream/_definst_/master.m3u8
#EXTINF:0 tvg-logo="https://i.imgur.com/ODIWC6n.jpg" tvg-name="Infowars" tvg-id="Infowars" group-title="News",Infowars Live 2
https://infowarslive-lh.akamaihd.net/i/infowarsevent_1@366809/master.m3u8
#EXTINF:0 tvg-name="Russia today News" tvg-country="RU" tvg-language="English" tvg-logo="https://i.imgur.com/QY4B8Hg.png" group-title="News",RT News
https://rt-news-gd.secure2.footprint.net/1103.m3u8
#EXTINF:0 tvg-name="Russia today USA" tvg-country="RU" tvg-language="English" tvg-logo="https://i.imgur.com/QY4B8Hg.png" group-title="News",RT USA