Skip to content

Instantly share code, notes, and snippets.

View yegorgavrilov's full-sized avatar
💻

Yegor Gavrilov yegorgavrilov

💻
View GitHub Profile
@yegorgavrilov
yegorgavrilov / convert-crt-to-jks.sh
Created February 21, 2022 11:32 — forked from ansulev/convert-crt-to-jks.sh
Convert .CRT y .KEY Certificates to JKS Keystore
# Convert it into pkcs12 format
openssl pkcs12 -export -out jenkins.p12 -inkey certificate.key -in certificate.crt -name "jenkins-cert"
# Create keystore if not exist
https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html
# Import
keytool -importkeystore -srckeystore jenkins.p12 -srcstoretype pkcs12 -destkeystore keystore.jks
@yegorgavrilov
yegorgavrilov / networkCommand.md
Created March 12, 2021 19:18 — forked from raulmoyareyes/networkCommand.md
Linux command to check Internet connection speed.

# View public IP

  • curl -s checkip.dyndns.org | sed 's#.Address: (.)</b.*#\1#'
  • wget -qO - icanhazip.com
  • curl ifconfig.me
  • curl ident.me
  • dig +short myip.opendns.com @resolver1.opendns.com
  • lynx -dump ifconfig.me | grep 'IP Address'
  • curl ipecho.net/plain
  • curl bot.whatismyipaddress.com
  • curl ipinfo.io
#!/bin/bash
### Copy/paste from https://wiki.ubuntu.com/JonathanFerguson/Quagga
## Use
## ===
## $ sudo ./installQuagga.sh
## Install the Quagga routing daemon
## =================================
apt-get -y install quagga
# basic pfctl control
# ==
# Related: http://www.OpenBSD.org
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@yegorgavrilov
yegorgavrilov / netezza-basic-commands.txt
Created December 20, 2018 13:48
IBM Netezza SQL basic commands
\a toggle between unaligned and aligned mode
\act show current active sessions
\c[onnect] [dbname [user] [password]]connect to new database (currently 'RJEYARAJ_DB')
\C <title> HTML table title
\copy ... perform SQL COPY with data stream to the client machine
\d <table> describe table (or view, index, sequence, synonym)
\d{t|v|i|s|e|x} list tables/views/indices/sequences/temp tables/external tables
\d{m|y} list materialized views/synonyms
\dS{t|v|i|s} list system tables/views/indexes/sequences
@yegorgavrilov
yegorgavrilov / resize-fs.txt
Created September 17, 2018 11:19
Resize FS on Linux (extend partition size)
root@stg530:~# fdisk -l
Disk /dev/sdb: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9ccb23b5
Device Boot Start End Sectors Size Id Type
@yegorgavrilov
yegorgavrilov / install-ca.txt
Created September 6, 2018 08:32
Install trusted root certificate
## Debian/Ubuntu
cp ~/ca.crt /usr/local/share/ca-certificates/
update-ca-certificates
## CentOS/RHEL
yum install ca-certificates
update-ca-trust force-enable
cp ~/ca.crt /etc/pki/ca-trust/source/anchors/
@yegorgavrilov
yegorgavrilov / .bash_profile
Created August 24, 2018 04:41
setting colors and locale to allow mosh establish connection
###
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
@yegorgavrilov
yegorgavrilov / README.md
Created June 14, 2018 13:55 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/