Skip to content

Instantly share code, notes, and snippets.

View omps's full-sized avatar

Om Prakash Singh omps

View GitHub Profile
@omps
omps / README.md
Created March 30, 2019 18:33 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@omps
omps / gist:94fa0d1dc13c017429310717d6f2d9ca
Created April 12, 2018 13:55
Collect facts from hosts
# Display facts from all hosts and store them indexed by I(hostname) at C(/tmp/facts).
# ansible all -m setup --tree /tmp/facts
# Display only facts regarding memory found by ansible on all hosts and output them.
# ansible all -m setup -a 'filter=ansible_*_mb'
# Display only facts returned by facter.
# ansible all -m setup -a 'filter=facter_*'
# Collect only facts returned by facter.
@omps
omps / gist:bcb465d0d7a2526364a6a85d5bd5f21b
Created January 21, 2018 15:57
docker commands and errors
MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
ERROR: for lamp_db_1 Cannot create container for service db: Conflict. The container name "/lamp_db_1" is already in use by container "87dba9af0946191a3a60fd8868624d8954263e4edacf416c75c4d7b62c72d9d1". You have to remove (or rename) that container to be able to reuse that name.
ERROR: for db Cannot create container for service db: Conflict. The container name "/lamp_db_1" is already in use by container "87dba9af0946191a3a60fd8868624d8954263e4edacf416c75c4d7b62c72d9d1". You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.
Creating lamp_db_1 ... error
ANswer: no solution, just remove the container and recreate.
@omps
omps / gist:36a35eb4d57f59bf5bc5ab0a670297cb
Created May 14, 2017 04:24
power management in arch
https://wiki.archlinux.org/index.php/Power_management#Power_management_with_systemd
@omps
omps / gist:3fb0af225eda4470032008a8c0a5ee76
Created May 12, 2017 20:22
fix the journalctl error
For prosperity, the good women and the beer, I hereby record the following
- open the console!
- get to be root
- examine the output of "journalctl -xn" and "dmesg"
- if you get this or something similar
Quote:
[ 12.713167] systemd-journald[113]: Failed to write entry (9 items, 245 bytes), ignoring: Cannot assign requested address
- verify the journals with "journalctl --verify"
- check if the logs are within sizes "journalctl --disk-usage"
- by then you have an idea of the corrupted logs - they show up iin red, no way you can ignore them
@omps
omps / gist:eb1de5d34ac3c75013e6ec870ac7299c
Created March 26, 2017 01:15
Tmux start window pane from 1 instead of 0
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
@omps
omps / 1-server.sh
Created March 24, 2017 13:54 — forked from duritong/1-server.sh
Creating a pulp upload user
$ pulp-admin auth user create --login jenkins --password xxx
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/content/uploads/" -o read -o update -o create -o delete
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/tasks/" -o read
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/repositories/my-repo/actions/import_upload/" -o create -o execute -o read -o update
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/repositories/my-repo/actions/publish/" -o execute
@omps
omps / gist:9f9fb5ed0f70f5bccfc30c496d87ffef
Created January 4, 2017 16:49
mysql common pitfalls.
# show all users in the db.
SELECT User FROM mysql.user;
#create database
create database mysql_test;
# create new mysql user
GRANT ALL PRIVILEGES ON dbTest.* To 'user'@'hostname' IDENTIFIED BY 'password';
@omps
omps / cowroot.c
Created October 25, 2016 07:01 — forked from rverton/cowroot.c
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@omps
omps / jenkins-centos.md
Created May 29, 2016 08:10
Install jenkins on centos
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo #Installation of a stable version LTS YUM repository for the LTS Release Lin
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

sudo yum install java #jenkins require Java to be present.