Skip to content

Instantly share code, notes, and snippets.

View diegopacheco's full-sized avatar

Diego Pacheco diegopacheco

View GitHub Profile
@diegopacheco
diegopacheco / mount-external-HD-ubuntu-linux.md
Last active April 12, 2021 02:40
Can't mount external HD in Linux?
# figure out where the HD is 
sudo fdisk -l 
# mount it - for me was /dev/sdc so had to add 1 
sudo mount /dev/sdc1 /mnt
# to un mount
sudo umount /dev/sdc1
@diegopacheco
diegopacheco / s3-cheat-sheet-commands.md
Created March 9, 2021 20:17
S3 Cheat Sheet Commands

S3 Commands

## List files
aws ls cp s3://mybucket/

## print file content
aws s3 cp s3://mybucket/stream.txt -
@diegopacheco
diegopacheco / git-rebase-squash.md
Last active March 9, 2021 20:17
Git Rebase & Squash

Figure out the commit range

git log

Squash and edit commit message

###
### Commit RANGE from Older to Newer
### OLDER commit NEW COMMIT 
@diegopacheco
diegopacheco / tcpdump.md
Created February 25, 2021 16:54
TCP Dump
sudo tcpdump -i lo -A -s 0 tcp port 9000 -w server.pcap 
@diegopacheco
diegopacheco / generate-java-keystore-and-truststore.md
Created February 25, 2021 16:53
Generate Keystore and TrustStore
openssl genrsa -out serverCA.key 2048

openssl req -x509 -new -nodes -key serverCA.key -sha256 -days 1024 -out serverCA.pem

# add 123456 as password
openssl pkcs12 -export -name server-cert -in serverCA.pem -inkey serverCA.key -out serverkeystore.p12

keytool -importkeystore -destkeystore server.keystore -srckeystore serverkeystore.p12 -srcstoretype pkcs12 -alias server-cert
@diegopacheco
diegopacheco / idea-run-all-junit-tests.md
Created December 11, 2020 19:18
How do I make IntelliJ IDEA run all the Junit tests in a package including sub packages
  1. Run->Edit Configurations...
  2. Create a new junit test configuration
  3. Name it "All tests"
  4. Include entire package
  5. Select package root "com"
  6. Apply/Run.

image

@diegopacheco
diegopacheco / create-java-maven-project.sh
Last active February 27, 2021 21:08
create-java-maven-project.sh
#!/bin/bash
mkdir -p src/main/java
mkdir -p src/main/resources
mkdir -p src/test/resources
mkdir -p src/test/java
projectName=${PWD##*/}
echo "
@adrianlemess
adrianlemess / Code snippets.md
Last active December 27, 2019 17:42
Angular Awesome List

Snippets

Component:

  • HTML
<div *ngIf="item.length > 0">
@diegopacheco
diegopacheco / vault-sheet.md
Last active September 13, 2019 18:09
Vault Cheat Sheet

Open vault-ui

xdg-open "http://localhost:8200/ui/"

Test Vault login via API

curl --silent -k -X GET -H "X-Vault-Token:00000000-0000-0000-0000-000000000000" 'http://127.0.0.1:8200/v1/auth/token/lookup-self'

Test Read Secret via API

@diegopacheco
diegopacheco / vscode-plugins-export.md
Created February 28, 2019 02:26
Generate plugin install for VSCode
code --list-extensions | xargs -L 1 echo code --install-extension