Skip to content

Instantly share code, notes, and snippets.


Sachin psachin

View GitHub Profile
brenopolanski /
Last active Jul 31, 2022
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

iAugur / ansible-add-string-to-line.yml
Last active Jul 26, 2022
Ansible: Add a String to an existing line in a file
View ansible-add-string-to-line.yml
# Adapted from solution provided by
# Scenario: You want to add a group to the list of the AllowGroups in ssh_config
# before:
# AllowGroups Group1
# After:
# AllowGroups Group1 Group2
- name: Add Group to AllowGroups
backup: yes
dmgerman / directory-files-recursive.el
Last active May 1, 2022
Recursively list files in a given directory
View directory-files-recursive.el
;;; Recursively list files in a given directory
;;; Author: daniel m german dmg at uvic dot ca
;;; Copyright: daniel m german
;;; License: Same as Emacs
(defun directory-files-recursive (directory match maxdepth ignore)
"List files in DIRECTORY and in its sub-directories.
Return files that match the regular expression MATCH but ignore
psachin / network
Created Feb 20, 2018
D-Link DIR-615 "shark" file: /etc/config/network
View network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr ''
option netmask ''
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
psachin / ceilo-gnocchi-aodh-notes.txt
Last active Mar 7, 2019
View ceilo-gnocchi-aodh-notes.txt
Gnocchi Archive policies
1. Capture data every 1 minute for 1 day
[heat-admin@overcloud-controller-2 ~]$ gnocchi archive-policy create 1min1day -d granularity:1m,timespan:1d
| Field | Value |
| aggregation_methods | std, count, 95pct, min, max, sum, median, mean |
| back_window | 0 |
gbraad /
Created Jun 23, 2016
Install TripleO on baremetal using Quickstart

Install TripleO on baremetal using Quickstart

This gist contains the files and scripts used to deploy to baremetal. Be aware wasn't really used in this way. The steps were actually performed from an interactive session (due to issues with the overcloud loosing connectivity).

The undercloud image needs to be build or download and stored in /var/lib/oooq-images/.

jairojunior / cfme-rh-sso.yml
Created Jan 4, 2018
Playbook to configure CFME login with RH-SSO
View cfme-rh-sso.yml
- hosts: all
become: yes
become_user: root
appliance_file_name: "https_{{ appliance_name }}"
- name: SAML configuration dir
psachin /
Last active Dec 27, 2017
Check workers with exceeded memory on Red Hat CloudForms
# Author: Niladri Roy <>
# Usage:
# 1) without specifing evm.log file
# curl -s | bash -
# 2) specify file name
# curl -s | bash -s evm.log-20171103
if [ -z $1 ];
psachin /
Last active Nov 30, 2017
Notes from tripleo-quickstart bootcamp session


All in one(single physical node deployment)

adduser NON-ROOT-USER -G wheel

# login as NON-ROOT-USER
export VIRTHOST=
ssh-copy-id root@$VIRTHOST
psachin / battery.diff
Created Nov 7, 2017
Making below changes battery status shows correctly
View battery.diff
diff --git a/lisp/battery.el b/lisp/battery.el
index b1834f06ff8d..dd0b8f652426 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -58,7 +58,7 @@
((and (eq system-type 'gnu/linux)
(file-directory-p "/proc/acpi/battery"))
- ((and (eq system-type 'gnu/linux)
+ ((and (or (eq system-type 'gnu/linux) (eq system-type 'gnu))