Skip to content

Instantly share code, notes, and snippets.

View rpfilomeno's full-sized avatar
💭
For Hire

Roger Filomeno rpfilomeno

💭
For Hire
View GitHub Profile
#!/bin/bash
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
## License: GNU General Public License v2, v3
#
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/`basename $0`"
@rpfilomeno
rpfilomeno / Yeoman + Composer + Bower + AngularJS + SLIM
Created October 28, 2014 16:51
Yeoman + Composer + Bower + AngularJS + SLIM
1. Install composer (http://getcomposer.org/doc/00-intro.md#installation)
2. php composer.phar create-project slim/slim-skeleton server
3. npm install -g yo grunt-cli bower
4, npm install -g generator-angular
5. yo angular
6. bower install angular-bootstrap --save
7. edit bowerrc to make sure it points to the correct directory
8. cd server
9. php composer.phar slim-json-api
@rpfilomeno
rpfilomeno / Polycom Provisioning
Last active September 29, 2016 00:33
Polycom Provisioning
Firmwares:
http://downloads.polycom.com/voice/voip/sip_sw_releases_matrix.html
http://downloads.polycom.com/voice/voip/uc_sw_releases_matrix.html
Configuration:
http://etel.wiki.oreilly.com/wiki/index.php/Dynamic_Phone_Provisioning_with_res_phoneprov_and_TFTP
https://freeswitch.org/confluence/display/FREESWITCH/Polycom+Configuration
Reset Codes:
1. Find and write down the MAC id of the phone you want to reset. You can typically find it on the back of the phone. If the label on the back of the phone with the MAC id is removed, you can find it by pressing Menu, Status, Network, Ethernet.
@rpfilomeno
rpfilomeno / Cool Tools
Last active June 21, 2018 16:29
Cool Tools
The following are list of tools i use.
Encryption:
ShadowCrypt
Programming IDEs:
PHPStorm
IntelliJ
RStudio/Revolution R Open
RegEx Buddy
@rpfilomeno
rpfilomeno / Replication check
Created November 10, 2014 23:34
Postgres Tricks
On Master:
SELECT
client_addr,
sent_offset - (
replay_offset - (sent_xlog - replay_xlog) * 255 * 16 ^ 6 ) AS byte_lag
FROM (
SELECT
client_addr,
('x' || lpad(split_part(sent_location, '/', 1), 8, '0'))::bit(32)::bigint AS sent_xlog,
@rpfilomeno
rpfilomeno / yajl make install log
Created November 12, 2014 18:34
Building modsecurity-2.8.0
$./configure --with-yajl=/usr/local/include/yajl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
@rpfilomeno
rpfilomeno / ModSecurity Installation + OWASP CRS for Centos 6.5
Last active February 28, 2020 16:40
ModSecurity Installation + OWASP CRS for Centos 6.5
Install yajl2
$cd ~
$git clone https://github.com/lloyd/yajl.git
$cd yajl/
$sudo ./configure
$sudo make
$sudo make install
$sudo ln -s /usr/local/lib/libyajl_s.a /usr/lib64/libyajl_s.a
@rpfilomeno
rpfilomeno / ICMP PING implementation in PHP
Last active August 29, 2015 14:10
PHP Code Snippets
function ping($host, $timeout = 1) {
/* ICMP ping packet with a pre-calculated checksum */
$package = "\x08\x00\x7d\x4b\x00\x00\x00\x00PingHost";
$socket = socket_create(AF_INET, SOCK_RAW, 1);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => $timeout, 'usec' => 0));
socket_connect($socket, $host, null);
$ts = microtime(true);
socket_send($socket, $package, strLen($package), 0);
if (socket_read($socket, 255)) {
$result = microtime(true) - $ts;
@rpfilomeno
rpfilomeno / Linux Static IP
Last active August 29, 2015 14:11 — forked from fernandoaleman/Linux Static IP
Linux Networking
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@rpfilomeno
rpfilomeno / SOX convert ring tone to G.71-ULAW for Polycom
Last active August 29, 2015 14:11
SOX Commands for VOIP, Asterisk, Polycom, etc
# sox SuperMario.wav -r 8000 -U -c1 SuperMarioUL.wav