Skip to content

Instantly share code, notes, and snippets.

View ivaliullinbars's full-sized avatar

ivaliullinbars

View GitHub Profile
echo | openssl s_client -showcerts -servername domain.name -connect server.address:443 2>/dev/null | openssl x509 -inform pem -noout -text
openssl x509 -in cert.crt -text
# To open a DER certificate:
openssl x509 -in cert.crt -inform DER -text
# To display pkcs12 certificate information:
openssl pkcs12 -in cert.crt -info
-- copied from https://www.veritas.com/support/en_US/article.100020849.html
-- create backup user in oracle 11g
-- in oracle 12c only need grant SYSBACKUP privilege
-- https://www.veritas.com/support/en_US/article.100020849.html
CREATE USER BACKUP IDENTIFIED BY ORACLE;
-- (BACKUP is the account name and ORACLE is the password in this example.)
GRANT UNLIMITED TABLESPACE TO BACKUP;
GRANT AQ_ADMINISTRATOR_ROLE TO BACKUP;
GRANT SYSDBA TO BACKUP;
gdb postgres PID
printf “%s\n”, debug_query_string
printf "%s\n", debug_query_string
@ivaliullinbars
ivaliullinbars / proc_net_tcp_decode
Created January 24, 2019 09:43 — forked from jkstill/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@ivaliullinbars
ivaliullinbars / kubernetes_add_service_account_kubeconfig.sh
Created December 18, 2018 11:35 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
https://github.com/chef/bento
https://github.com/gildas/packer-windows
https://github.com/joefitzgerald/packer-windows
https://github.com/ruzickap/packer-templates
windows templates
Before start build windows templates, you need download and unpack Windows VirtIO Drivers to ./virtio path in this repo
@ivaliullinbars
ivaliullinbars / install-gcc48-linuxbrew-centos6.md
Created November 15, 2018 12:38 — forked from stephenturner/install-gcc48-linuxbrew-centos6.md
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

@ivaliullinbars
ivaliullinbars / postgres-import-export-csv.md
Created October 5, 2018 14:29 — forked from nepsilon/postgres-import-export-csv.md
Importing and Exporting CSV files with PostgreSQL — First published in fullweb.io issue #19

Importing and exporting CSV files with PostgreSQL

Let’s see how to use PostgreSQL to import and export CSV files painlessly with the COPY command.

Import CSV into table t_words:

COPY t_words FROM '/path/to/file.csv' DELIMITER ',' CSV;

You can tell quote char with QUOTE and change delimiter with DELIMITER.

[Default Applications]
x-scheme-handler/http=chromium.desktop;
x-scheme-handler/https=chromium.desktop;
x-scheme-handler/ftp=chromium.desktop;
x-scheme-handler/chrome=chromium.desktop;
application/x-extension-htm=chromium.desktop;
application/x-extension-html=chromium.desktop;
application/x-extension-shtml=chromium.desktop;
application/x-extension-xhtml=chromium.desktop;
application/x-extension-xht=chromium.desktop;