Skip to content

Instantly share code, notes, and snippets.

View cenrak's full-sized avatar

Raed Alkharboush cenrak

View GitHub Profile
@cenrak
cenrak / replace_hash_tags.js
Created April 23, 2012 04:28
Hash Tag replacer
// فين المفروض المكتبة تبحث عن الهاش تاق. حاليا تدعم مكان واحد بس
var whereToSearch = 'p.reply';
// التعبير القياسي لشكل الهاش تاق
var howItLooksLike = '\\#[A-Za-z0-9\u0600-\u06ff_]+';
// موقعك
var site = "http://website.com/";
// ما تضيفه المكتبة في الرابط بعد رابط موقعك و قبل إضافة الهاش تاق
#/bin/bash
for ip in `cat ips.list`
do
ssh $ip /sbin/iptables -I INPUT -s $1 -j DROP
done
#/bin/bash
for ip in `cat ips.list`
do
ssh $ip /sbin/iptables -D INPUT -s $1 -j DROP
done
#/bin/bash
LIST=`cat ips.list`
for ip in $LIST
do
scp blocked_ips.list $ip:/tmp
ssh $ip "bash update-blocked-ips; rm -f /tmp/blocked_ips.list"
done
#/bin/bash
iptables --flush
service iptables save
service iptables stop
service iptables start
BIPS=`cat /tmp/blocked_ips.list`
#include <iostream>
int main()
{
int num = 0;
int count = 0, sum = 0, i, j, p;
char c;
module AIO
require 'nokogiri'
require 'open-uri'
class R
class << self
def class
#!/usr/bin/env python
import sys
def permutations(input):
possibilities = set()
def _perm(prev, rem):
if len(rem):
for i in range(len(rem)):
@cenrak
cenrak / getpagetitle.sh
Last active July 1, 2017 08:03
getpagetitle.herokuapp.com
$ curl -X GET http://getpagetitle.herokuapp.com/get_title?url=https://www.facebook.com/
{
"return_code": 200,
"title": "Facebook - Log In or Sign Up",
"url": "https://www.facebook.com/"
}
@cenrak
cenrak / Vagrantfile
Created May 3, 2018 17:41
Vagrantfile to prepare a quick katello infrastructure.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.define "foreman" do |foreman|