Skip to content

Instantly share code, notes, and snippets.

View gnurag's full-sized avatar

Anurag gnurag

  • Red Hat, Inc.
  • Far far away land
View GitHub Profile
@gnurag
gnurag / index.js
Created December 14, 2021 19:48 — forked from WietseWind/index.js
account_objects (type: state) to account_lines responses: get lines based on reserve claim
const { XrplClient } = require('xrpl-client')
const client = new XrplClient()
const myAccount = 'rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ'
const objectFlags = {
lsfLowReserve: 0x00010000,
lsfHighReserve: 0x00020000,
lsfLowNoRipple: 0x00100000,
lsfHighNoRipple: 0x00200000
$ pdf-stapler cat many-pages.pdf 1 first-page.pdf
@gnurag
gnurag / tls-setup.txt
Created July 2, 2019 12:14
TLS setup with LetsEncrypt
yum install nginx certbot
systemctl enable nginx
systemctl start nginx
certbot certonly -n --agree-tos --email gnurag@gmail.com --webroot -w /usr/share/nginx/html -d keycloak.journalctl.org
# Certificate: /etc/letsencrypt/live/keycloak.journalctl.org/fullchain.pem
# Private Key: /etc/letsencrypt/live/keycloak.journalctl.org/privkey.pem
# After 3 months
certbot renew
@gnurag
gnurag / example-ca.txt
Created June 14, 2019 13:38
Custom certificates signed by Custom CA
# Create Custom CA key
$ openssl genrsa -des3 -out ExampleCA.key 4096
# Create an sign Custom CA
$ openssl req -x509 -new -nodes -key ExampleCA.key -sha256 -days 3650 -out ExampleCA.crt
# Generate a Custom Certificate key
$ openssl genrsa -out example.com.key 2048
# Generate Custom Certificate Signing Request
[root@hp-dl380pgen8-02-vm-6 cache]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base beaker-distro beaker-harness beaker-tasks centos-sclo-rh centos-sclo-sclo epel extras foreman foreman-plugins puppet5 tfm-ror51 updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@hp-dl380pgen8-02-vm-6 cache]#
@gnurag
gnurag / Vagrantfile
Created March 16, 2018 11:54
Minimalist Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.ssh.insert_key = true
config.vm.box = "centos/7"
config.vm.provider :libvirt do |libvirt|
libvirt.memory = 1024
libvirt.cpus = 1
@gnurag
gnurag / .muttrc
Last active February 28, 2018 08:11
mutt setup
## $Id: .muttrc,v 0.3 Jan 11 23:21:42 IST 2004 Anurag Patel $
# My .muttrc file, (C) 2004, 2005, 2012, 2015, 2017 Anurag
#
# Notes: When viewing filtered mails using 'l' key,
# then use ~A to display all mails.
push <show-version> # show version on startup
##################################################
## My General settings
@gnurag
gnurag / cowsay
Created April 7, 2017 07:27
cowsay
echo Cowception | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | \
cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | \
cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | \
cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | cowsay -n | \
cowsay -n
@gnurag
gnurag / template.conf
Created March 9, 2017 11:54
Nginx VirtualHost template
### VirtualHost config file for www.SITENAME.com
#upstream SITENAME_production {
# server 127.0.0.1:4200;
#}
server {
listen 80;
server_name www.SITENAME.com;
access_log /var/log/nginx/SITENAME.com/www_access.log;
%{?scl:%scl_package rubygem-%{gem_name}}
%{!?scl:%global pkg_name %{name}}
%global gem_name foreman_maintain
%global confdir foreman_maintain
%{!?_root_bindir:%global _root_bindir %{_bindir}}
%{!?_root_mandir:%global _root_mandir %{_mandir}}
%{!?_root_sysconfdir:%global _root_sysconfdir %{_sysconfdir}}