Skip to content

Instantly share code, notes, and snippets.

Avatar

Om Prakash Singh omps

View GitHub Profile
@omps
omps / unfollow.js
Created Aug 30, 2020 — forked from JamieMason/unfollow.js
Unfollow everyone on twitter.com
View unfollow.js
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated: 09 April 2020
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
View jekyll quick tips
jekyll on different port
jekyll serve --port 4001 --host my_hostname_or_ip
affilaite theme for jekyll
https://github.com/omps/affiliates-jekyll-theme
@omps
omps / README.md
Created Mar 30, 2019 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications
View README.md


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.


View gist:94fa0d1dc13c017429310717d6f2d9ca
# 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.
View gist:bcb465d0d7a2526364a6a85d5bd5f21b
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.
View gist:36a35eb4d57f59bf5bc5ab0a670297cb
https://wiki.archlinux.org/index.php/Power_management#Power_management_with_systemd
View gist:3fb0af225eda4470032008a8c0a5ee76
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 Mar 26, 2017
Tmux start window pane from 1 instead of 0
View gist:eb1de5d34ac3c75013e6ec870ac7299c
# 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 Mar 24, 2017 — forked from duritong/1-server.sh
Creating a pulp upload user
View 1-server.sh
$ 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
View gist:9f9fb5ed0f70f5bccfc30c496d87ffef
# 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';
You can’t perform that action at this time.