Skip to content

Instantly share code, notes, and snippets.

Avatar

Om Prakash Singh omps

View GitHub Profile
@omps
omps / wincmd.md
Last active Jan 22, 2022
A Gist of Windows Commands for Linux Admins
View wincmd.md

Windows Docker Kubernetes Commands for Linux Admins

1.a. Find windows system path on windows terminal Run path command on any cmd prompt and this should print the path output, tested on windows 10

D:\> path

1.b. Find and temporarily modify windows system path on powershell windows 10

PS D:\> $env:Path
@omps
omps / deleteWordbefore
Last active Jan 22, 2022
Visual Studio Code - Ctrl + Backspace set to deleteWordBefore
View deleteWordbefore
Based on the latest comment https://github.com/microsoft/vscode/issues/68167 I have modified JerryGoyal's answer so we don't have to modify bindings:
Put the following at the top of your Microsoft.PowerShell_profile.ps1 config file (type $profile in the terminal to find it, you might have to create one if it doesn't exist already)
```PowerShell_profile
if ($env:TERM_PROGRAM -eq "vscode") {
Set-PSReadLineOption -EditMode Emacs
}
This works for me (vscode 1.43)
@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