Skip to content

Instantly share code, notes, and snippets.

$wsh = New-Object -ComObject Wscript.Shell; WHILE($TRUE){$wsh.SendKeys("{SCROLLLOCK}");$wsh.SendKeys("{SCROLLLOCK}");START-SLEEP -Seconds (Get-Random -Minimum 45.1 -Maximum 110.99)}
@padmick
padmick / Pep.ps1
Created May 12, 2021 11:12
Exporting event logs to excel
Set-Variable -Name EventAgeDays -Value 1 #we will take events for the last one days, can bump later if needed
Set-Variable -Name CompArr -Value @("SERV1") # where it says serv1 replace with your PC name
Set-Variable -Name LogNames -Value @("Application", "System") # Checking app and system logs
Set-Variable -Name EventTypes -Value @("Error", "Warning") # Loading only Errors and Warnings
Set-Variable -Name ExportFolder -Value "C:\TEST\"
$el_c = @() #consolidated error log
$now=get-date
$startdate=$now.adddays(-$EventAgeDays)

DDoS protection starts with DNS protection and works as follows:

  • Requests to your domain name do not come to your server, but to intermediate Cloudflare servers
  • Cloudflare checks the source of the request and, if an attack is detected, the request blocked
  • If the request is secure, it is passed to your server for processing.

Cloudflare has a lot of servers distributed throughout the world. They take the brunt of DDoS attacks, leaving your server safe. In addition to that:

{
"hotels": [
{
"HotelID": 561,
"HotelName": "Avanti Palms Resort and Conference Center",
"Phone": "407-996-0900",
"CustomDisplay": false,
"CustomDisplayText": "",
"Website": "",
"CurrencySymbol": "$",
/u/Zudegia (171 points, 94 comments)
/u/Mailbox538 (160 points, 67 comments)
/u/Koekoeksklok88 (78 points, 33 comments)
/u/Ploxxx69 (74 points, 37 comments)
/u/S_B_C_R (73 points, 29 comments)
/u/AriTheBlari (66 points, 21 comments)
/u/Konan87 (52 points, 31 comments)
/u/repi7971 (52 points, 13 comments)
/u/445323 (49 points, 27 comments)
/u/velvetmimosas (48 points, 28 comments)
{
"swagger": "2.0",
"info": {
"description": "",
"title": "test1",
"version": "v1.0.0"
},
"schemes": [
"http",
"https"
{
"swagger": "2.0",
"info": {
"description": "",
"title": "test",
"version": "v1.0.0"
},
"schemes": [
"http",
"https"
@padmick
padmick / testDeploy.sh
Last active August 13, 2019 10:38
testDeploy
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.6.3
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs &&
sudo DEBIAN_FRONTEND=noninteractive ln -sf /usr/bin/nodejs /usr/local/bin/node
export DEBIAN_FRONTEND=noninteractive
# Install our PGP key and add HTTPS support for APT
sudo DEBIAN_FRONTEND=noninteractive apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates

Keybase proof

I hereby claim:

  • I am padmick on github.
  • I am padraicwade (https://keybase.io/padraicwade) on keybase.
  • I have a public key whose fingerprint is A9CD 9296 92D8 B7BA 986B FD5B 7276 FE80 DFDB FBE1

To claim this, I am signing this object:

#to find the max of one row in the file
from pyspark import SparkContext
def mapMax(line):
line = line.split(',')
return line[0], max((float(x) for x in line[1:]))
textfile = sc.textFile("wasb://wgkspark@teststoragespark.blob.core.windows.net/dataA.csv").cache()
lines = textfile.takeSample(False, 50)
print mapMax(lines[-1])
#print lines[0] was just for debugging