Skip to content

Instantly share code, notes, and snippets.

View danielchc's full-sized avatar
🍋

/dani danielchc

🍋
View GitHub Profile
@danielchc
danielchc / testProxy.py
Created June 12, 2018 19:24
Test proxy
from urllib import request as urlrequest
proxy_host = 'ip:port'
url = 'http://www.httpbin.org/ip'
#If returns 2 IP means that X-Forwarded isn't disabled
req = urlrequest.Request(url)
req.set_proxy(proxy_host, 'http')
@danielchc
danielchc / squid.conf
Created June 12, 2018 19:28
Sample Squid remote proxy configuration
acl clients src <IP>
http_access allow clients
http_port 8080
via off
forwarded_for off
follow_x_forwarded_for deny all
request_header_access X-Forwarded-For deny all
header_access X_Forwarded_For deny all
@danielchc
danielchc / DistributionLists.ps1
Created June 13, 2018 14:48
Lists users from each Distribution List (DL)
param([String]$FileName='DistributionLists.csv')
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 2>$nul
$groups=ForEach ($i in Get-DistributionGroup){
Get-DistributionGroupMember $i | Select @{n='DistributionName';e={$i.Name}},@{n='DistributionMail';e={$i.PrimarySmtpAddress}},Name,PrimarySmtpAddress
}
$groups |Export-CSV $FileName -NoTypeInformation -Encoding UTF8
@danielchc
danielchc / InstallPrinter.ps1
Last active June 13, 2018 14:49
Install printer from Print Server and set as default
param([String]$printerTarget='',[String]$printServer='')
$conex="\\$printServer\$printerTarget"
if ((Get-Printer).Name -eq $conex){
"Printer already installed: $($printerTarget)"
}else{
$printClass = [wmiclass]"Win32_Printer"
$printClass.AddPrinterConnection($conex) | Out-Null
(Get-WmiObject -Class Win32_Printer -Filter "ShareName='$($printerTarget)'").SetDefaultPrinter() | Out-Null
"Installed: $($printerTarget)"
@danielchc
danielchc / ADGroupMember.ps1
Created June 13, 2018 14:51
List members from AD Security Group (without "Domain *" groups)
param([String]$FileName='ADGroups.csv')
Import-Module ActiveDirectory 2>$nul
$groups=ForEach ($i in Get-ADGroup -Filter 'groupcategory -eq "security"' -searchbase "OU=Domain Users,dc=ORGANITATION,dc=local" | Where-Object { !($_.Name -like "*Domain*")} ){
Get-ADGroupMember $i | Where-Object {($_.objectClass -eq "user")} | Select @{n='DistributionName';e={$i.Name}},Name,SamAccountName
}
$groups |Export-CSV $FileName -NoTypeInformation -Encoding UTF8
@danielchc
danielchc / dnstool.bat
Created September 8, 2018 18:13
Check ping of diferent DNS Servers
@echo off
set dnsservers=1.1.1.1 1.0.0.1 9.9.9.9 149.112.112.112 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 91.239.100.100 89.233.43.71
(for %%a in (%dnsservers%) do (
ping -n 1 %%a |findstr "TTL="
))
pause
for /f "skip=4 usebackq tokens=2" %%a in (`nslookup myip.opendns.com resolver1.opendns.com`) do echo %%a
0.0.0.0 a.stat.xiaomi.com
0.0.0.0 abtest.mistat.intl.xiaomi.com
0.0.0.0 abtest.mistat.xiaomi.com
0.0.0.0 ad.mi.com
0.0.0.0 ad.xiaomi.com
0.0.0.0 ad1.xiaomi.com
0.0.0.0 adv.sec.miui.com
0.0.0.0 api.account.xiaomi.com
0.0.0.0 api.ad.xiaomi.com
0.0.0.0 api.admob.xiaomi.com
@danielchc
danielchc / elPaisLimite.js
Last active December 19, 2021 10:37
Quitar límite articulos ElPais
// ==UserScript==
// @name Quitar Limite El Pais
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Quitar límite articulos ElPais
// @author danielchc
// @match https://elpais.com/*
// @grant none
// ==/UserScript==
@danielchc
danielchc / docker-emby-bypass.md
Last active November 15, 2024 16:42
Emby Premiere: ByPass Docker container

Emby Premiere ByPass Docker container

❗ All the information provided on this tutorial are for educational purposes only. I'm not responsible for any misuse of this information. If you like the app buy it

Table of Contents