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
Set-StrictMode -Version Latest | |
# Constants | |
if (!(Test-Path variable:\NET_FW_DISABLED)) { Set-Variable NET_FW_DISABLED $False } | |
if (!(Test-Path variable:\NET_FW_ENABLED)) { Set-Variable NET_FW_ENABLED $True } | |
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_TCP)) { Set-Variable NET_FW_IP_PROTOCOL_TCP 6 } | |
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_UDP)) { Set-Variable NET_FW_IP_PROTOCOL_UDP 17 } | |
if (!(Test-Path variable:\NET_FW_PROFILE_DOMAIN)) { Set-Variable NET_FW_PROFILE_DOMAIN 0x1 } | |
if (!(Test-Path variable:\NET_FW_PROFILE_PRIVATE)) { Set-Variable NET_FW_PROFILE_PRIVATE 0x2 } | |
if (!(Test-Path variable:\NET_FW_PROFILE_PUBLIC)) { Set-Variable NET_FW_PROFILE_PUBLIC 0x2 } |
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
input { | |
syslog { | |
type => "haproxy-access" | |
port => 514 | |
} | |
} | |
filter { | |
grok { | |
type => "haproxy-access" |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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
Para CPF | |
/^\d{3}\.\d{3}\.\d{3}\-\d{2}$/ | |
Para CNPJ | |
/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/ | |
Para ambos ao mesmo tempo |
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 | |
/** | |
* Requires php >= 5.5 | |
* | |
* Use this script to convert utf-8 data in utf-8 mysql tables stored via latin1 connection | |
* This is a PHP port from: https://gist.github.com/njvack/6113127 | |
* | |
* @link : http://www.ridesidecar.com/2013/07/30/of-databases-and-character-encodings/ | |
* | |
* BACKUP YOUR DATABASE BEFORE YOU RUN THIS SCRIPT! |
Some OVH dedicated server does not supports installing Debian original kernel due to hardware support issue.
Most common issue is the network adapter card.
- Intel ixgbe linux drivers : https://downloadcenter.intel.com/download/14687
- OVH forum : https://forum.ovh.co.uk/showthread.php?5616-Standard-Kernels-with-Ubuntu-Debian&p=73788&viewfull=1#post73788
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
# all logging settins are here on top | |
$logFile = "log-$(gc env:computername).log" | |
$logLevel = "DEBUG" # ("DEBUG","INFO","WARN","ERROR","FATAL") | |
$logSize = 1mb # 30kb | |
$logCount = 10 | |
# end of settings | |
function Write-Log-Line ($line) { | |
Add-Content $logFile -Value $Line | |
Write-Host $Line |
Generating a self-signed certificate is a common task and the command to generate one with openssl
is well known and well documented. Generating a certificate that includes subjectAltName is not so straght forward however. The following example demonstrates how to generate a SAN certificate without making a permanent change to the openssl configuration.
$ export SAN="DNS:www.domain.localdomain,DNS:domain.localdomain"
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
# A sample script to create a temporary copy of a Paradox database, connect to it, and query it. | |
# Requires PyPyODBC: https://pypi.python.org/pypi/pypyodbc | |
# Written by Anthony Eden - http://mediarealm.com.au/ | |
import os | |
import shutil | |
import pypyodbc |
OlderNewer