Skip to content

Instantly share code, notes, and snippets.

Luis García angelbladex

Block or report user

Report or block angelbladex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@angelbladex
angelbladex / Blocking Youtube in Pfsense
Last active Oct 28, 2019
How blocked Youtube with ips on Pfsense
View Blocking Youtube in Pfsense
Hi!
On https://gist.github.com/marshymarsh/5c34b5a6530d46fa0f3076bed52d293a#gistcomment-2739570 there are a list for block youtube.
But this is a problem because multiple domains on firewall is fatal. ou can convert this domains to Ips with a script like
#!/bin/bash
filename='DomainsYoutube'
View format.sh
#!/bin/bash
#put first letter of each word on Uppercase
cat file | tr "[A-Z]" "[a-z]" | sed -e "s/\b\(.\)/\u\1/g" > newFile
@angelbladex
angelbladex / pm.h diff update
Created Jun 6, 2016 — forked from guilespi/pm.h diff update
Compile latest igb driver on debian squeeze 2.6.32-5-amd64
View pm.h diff update
/*When presented with failure
*igb-3.4.8/src/igb_main.c:193: error: implicit declaration of function SET_RUNTIME_PM_OPS
*
*Add the following macro to
*/usr/src/linux-headers-2.6.32-5-common/include/linux/pm.h
*/
#ifdef CONFIG_PM_RUNTIME
#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
.runtime_suspend = suspend_fn, \
.runtime_resume = resume_fn, \
@angelbladex
angelbladex / update_mirrors.sh
Last active May 5, 2016
Determinate 6 fasterst mirrors for ArchLinux
View update_mirrors.sh
#!/bin/bash
limit=6
file="/tmp/mirrorlist.pacnew"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@angelbladex
angelbladex / track.sh
Last active May 5, 2016
Determinate hosts alive from subnet
View track.sh
#!/bin/bash
subnet="192.168.16.0/24"
#sudo nmap -sP $subnet | grep report | grep -oE "[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}" | tr '\n' ' '
#sudo nmap -sP $subnet | grep report | grep -oE "[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}"
sudo nmap -sP $subnet | grep report | grep -oE "([[:digit:]]{1,3}.){3}[[:digit:]]{1,3}"
@angelbladex
angelbladex / vpn.sh
Last active May 13, 2016
Using openconnect for access to VPN server via script
View vpn.sh
#!/bin/bash
username="user@hostname"
password="your-Complex-password"
url="Your-URL"
pidfile="/tmp/openconnect-pid"
case "$1" in
start)
@angelbladex
angelbladex / curlTest.php
Last active Oct 12, 2015
some code on PHP for test access to websites with curl
View curlTest.php
<?php
function nxs_cURLTest($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
$response = curl_exec($ch);
@angelbladex
angelbladex / totime.sh
Created Sep 1, 2015
Convert to human readable, unix timestamp
View totime.sh
#!/bin/bash
perl -pe 's/(\d+)/localtime($1)/e'
#i added this script in /usr/local/bin/
#sample usage
#grep youtube /var/log/squid3/access.log | totime
#tail -f /var/log/squid3/access.log | grep "/403" | totime
@angelbladex
angelbladex / sort-ips.sh
Created Aug 14, 2015
Sort ip address from a file
View sort-ips.sh
#!/bin/bash
sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n addresses_file
@angelbladex
angelbladex / validateIp.sh
Last active Aug 29, 2015
Validate Ip Address
View validateIp.sh
#!/bin/bash
#Validate a IP address
function valid_ip()
{
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
You can’t perform that action at this time.