Skip to content

Instantly share code, notes, and snippets.

View uranio-235's full-sized avatar
🐚
C# Developer at Work

Lázaro Armando uranio-235

🐚
C# Developer at Work
  • ChipojoSoft
  • Portugal
  • 17:25 (UTC +01:00)
View GitHub Profile
<VirtualHost *:80>
ServerAdmin admin@hcg.sld.cu
ServerName latencia.dominio.tld
DocumentRoot /usr/share/smokeping/www/
ScriptAlias /smokeping.cgi /usr/lib/cgi-bin/smokeping.cgi
Alias /smokeping /usr/share/smokeping/www/
<Directory />
Options +ExecCGI
Options +FollowSymLinks
@uranio-235
uranio-235 / ipfw
Created February 17, 2017 00:11
ipfw pipe
ipfw pipe 1 config bw 70KByte/s
ipfw add pipe 1 ip from any to 10.1.1.9 via xn0
ipfw add pipe 1 ip from any to 10.1.1.10 via xn0
ipfw add pipe 1 ip from any to 10.1.1.11 via xn0
root@quantum:~# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp6 0 0 :::5298 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s 10.1.1.2 -j ACCEPT
10.1.1.2 is now 169.254.0.20
xn0 = LAN 10.1.1.0/24 (for users)
xn1 = LAN = 169.254.0.0/16 (for servers, a kind of DMZ)
========= /etc/rc.conf
firewall_enable="YES"
firewall_script="/usr/local/etc/ipfw.rules"
gateway_enable="YES"
natd_enable="YES"
natd_interface="xn2"
natd_flags="-dynamic -m"
#!/usr/bin/lftp -f
set net:connection-limit 1
set net:limit-rate 81920:81920
lcd /mnt
open 'http://ftp.sld.cu'
cd 'archlinux'
mirror -cve -x '.*i686.*' core
mirror -cve -x '.*i686.*' extra
mirror -cve -x '.*i686.*' community
mirror -cve -x '.*i686.*' multilib
[root@artema desastedemi]# ls -l
ls: cannot access 'Preferences': No such file or directory
total 0
-????????? ? ? ? ? ? Preferences
@uranio-235
uranio-235 / mkcert.sh
Created May 30, 2017 01:56
generate and manage local CA
#!/bin/bash
# que longitud en de cifrado
longitud=2048
# la cantidad de días que tarda del CA en CAducar
# en este caso, usamos 10 años
caudocidad=3650
# a faebook y compañía solo se entre después de las 4pm
acl sonsera url_regex -i "/etc/squid/sonsera.list"
acl horario time MTWHF M-F 09:00-16:00
deny_info ERR_NO_FACEBOOK sonsera horario
http_access deny CONNECT sonsera horario
http_access deny sonsera horario
@uranio-235
uranio-235 / wdf.sh
Created January 5, 2019 03:55
bajar windows defender
#!/bin/sh
mkdir -p 'Windows Defender'
cd 'Windows Defender'
mv mpam-fe-exe mpm-fe.exe.old
wget -O mpam-fe.exe -c 'http://go.microsoft.com/fwlink/?LinkID=121721&arch=x64' && rm mpm-fe.exe.old || mv mpm-fe.exe.old mpm-fe.exe