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
const quicksort = (a) => { | |
if (a.length <= 1) { | |
return a | |
} | |
const pivot = a[0] | |
const low = [] | |
const hi = [] | |
a.map(i => { | |
i < pivot ? low.push(i) : null | |
i > pivot ? hi.push(i) : null |
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
# bastion host jump ssh | |
ssh -i key.pem -J user@host user@host |
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
locals { | |
users = [ | |
"SCREENSM1", | |
"SCREENSM2", | |
"SCREENSM3", | |
"SCREENSM4", | |
"SCREENSA1", | |
"SCREENSA2", | |
"SCREENSA3", | |
"SCREENSA4", |
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
Maximum heap size: | |
If physical memory size is up to 192 megabytes (MB) then default maximum heap size is half of the physical memory. | |
If physical memory size is more than 192 megabytes then default maximum heap size is one fourth of the physical memory. | |
Initial heap size: At least 8 MB or 1/64th of physical memory up to a physical memory size of 1 GB. | |
java -XX:+PrintFlagsFinal -version | grep HeapSize | |
The default thread stack size varies with JVM, OS and environment variables. | |
java -XX:+PrintFlagsFinal -version | grep ThreadStackSize |
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
sudo vi /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist | |
- Change “RunAtLoad” and “KeepAlive” to <false/> | |
sudo vi /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist | |
- Change “RunAtLoad” to <false/> |
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
(function shadowLoop () { | |
var host = document.getElementsByTagName('host-element-containing-shadow-root)[0]; | |
if (!host) { | |
setTimeout(shadowLoop, 500); | |
} else { | |
var style = document.createElement('style'); | |
style.innerHTML = '#SomeID {display: none !important}'; | |
host.shadowRoot.appendChild(style); | |
} | |
} ()); |
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
sudo /Applications/Docker.app/Contents/MacOS/qcow-tool resize --size=$(( 12 * 1024 * 1024 * 1024 )) "/var/root/Library/Application Support/multipassd/vault/instances/blissful-glowworm/ubuntu-20.04-server-cloudimg-amd64.img" |
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
ssh -M -S /tmp/db-socket -fnNT -L 3306:[RDS_ENDPOINT]:3306 [USER]@[BASTION_HOST] |
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/bash | |
sudo su | |
yum update -y | |
yum install -y httpd | |
amazon-linux-extras install java-openjdk11 | |
systemctl start httpd.service | |
systemctl enable httpd.service | |
EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone) | |
echo "<h1>Hello World from $(hostname -f) in AZ $EC2_AVAIL_ZONE </h1>" > /var/www/html/index.html |
NewerOlder