This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// pfSense PHP script to generate a range of DNS forwarder hosts based on | |
// "dot${lastoctet}", eg. 192.0.2.100 == dot100.example.com | |
// Open terminal, run "php" copy/paste script with the following defines tweaked | |
// Ctrl-D, wait a moment until you see "Content-type: text/html" | |
// Open the DNS config in the web UI and click Apply Changes | |
define('DOT_DOMAIN', 'example.com'); | |
define('DOT_SUBNET', '192.0.2.'); // Leave off the final octet, include the dot | |
define('DOT_RANGE_START', 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Disable ping reply Temporarily | |
You can temporarily disable the ping reply using the following method. | |
# echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all | |
Please note that this setting will be erased after the reboot. To disable ping reply permanently (even after the reboot), follow the step mentioned below. | |
Also, to enable the ping reply back, set the value to “0” as shown below. | |
# echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ blkid /dev/sdg1 | |
/dev/sdg1: LABEL="IPBXRECORDS" UUID="C4CD-C4FA" TYPE="exfat | |
$ ls /dev/disk/by-uuid -l | |
total 0 | |
lrwxrwxrwx 1 root root 10 Jun 25 13:10 2d2fdee8-1307-4df4-b3d9-7e69c4e05bfc -> ../../sde1 | |
lrwxrwxrwx 1 root root 10 Sep 21 05:18 2e21785b-b370-4e13-8449-6a5729ae3387 -> ../../dm-2 | |
lrwxrwxrwx 1 root root 10 Jun 25 13:10 3655492c-fe05-4e5d-bd41-f9b85c86e884 -> ../../sdd1 | |
lrwxrwxrwx 1 root root 10 Jun 25 13:11 36e9fd6f-bec6-4957-888c-c2d24b64f084 -> ../../sda1 | |
lrwxrwxrwx 1 root root 10 Jun 25 13:10 5122218b-1688-4412-b6c5-e72e79c68180 -> ../../sdc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpg --keyserver pgp.mit.edu --recv-keys <LA_CLE> | |
gpg --armor --export <LA_CLE> | apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -A "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search" -o /tmp/ips.raw "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search" | |
grep -aoEw -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?/[0-9]{2})" -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" /tmp/ips.raw | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n | uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$from = $_GET[from]; | |
$to = $_GET[to]; | |
$fromext = $_GET[fromext]; | |
$socket = fsockopen("localhost","5038", $errno, $errstr, $timeout); | |
fputs($socket, "Action: Login\r\n"); | |
fputs($socket, "UserName: USERNAME\r\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Heure, ROUND(AVG(nbAppels),2) nbAppelsMoyen | |
FROM | |
( | |
SELECT DATE_PART('day',eventtime) Jour, DATE_PART('hour',eventtime) Heure, count(DISTINCT cid_name) nbAppels | |
FROM cel | |
WHERE eventtime >= '2016-02-01 00:00:00' | |
AND eventtime < '2016-03-01 00:00:00' | |
AND eventtype = 'CHAN_START' | |
AND context = 'from-extern' | |
GROUP BY DATE_PART('day',eventtime), DATE_PART('hour',eventtime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$from = $_GET[from]; | |
$to = $_GET[to]; | |
$socket = fsockopen("localhost","5038", $errno, $errstr, $timeout); | |
fputs($socket, "Action: Login\r\n"); | |
fputs($socket, "UserName: USERNAME\r\n"); | |
fputs($socket, "Secret: PASSWORD\r\n\r\n"); | |
$wrets=fgets($socket,128); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sleep 30& sleep 60& | |
[1] 8007 | |
[2] 8008 | |
$ pkill -f 'sleep 30' | |
[1] - terminated sleep 30 | |
$ pgrep sleep | |
8008 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source : http://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/ | |
# cd /bin | |
# ln -s bash rbash | |
Extra setup to improve security : | |
http://blog.bodhizazen.net/linux/how-to-restrict-access-with-rbash/ |
OlderNewer