Skip to content

Instantly share code, notes, and snippets.

Avatar

Om Prakash Singh omps

View GitHub Profile
@omps
omps / simple_mta.md
Created September 5, 2022 15:49 — forked from n3dst4/simple_mta.md
Using Postfix as an MTA so that local mail on a linux box gets delivered to somewhere useful
View simple_mta.md

Simple Postfix MTA Setup for headless hobbyists

So, you're a hobbyist or maybe even a user in a small-scale business capacity and you have some kind of headless Linux (or other *nix) box, maybe it's a VPS or a Raspberry Pi, and you want it to be able to email you with alerts (setting up monitoring is a separate subject!)

History

I went round in circles with this for a while, because it seemed like such a

@omps
omps / wincmd.md
Last active January 22, 2022 13:53
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 January 22, 2022 06:39
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 August 30, 2020 16:58 — 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 March 30, 2019 18:33 — 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.


@omps
omps / gist:94fa0d1dc13c017429310717d6f2d9ca
Created April 12, 2018 13:55
Collect facts from hosts
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.
@omps
omps / gist:bcb465d0d7a2526364a6a85d5bd5f21b
Created January 21, 2018 15:57
docker commands and errors
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.
@omps
omps / gist:36a35eb4d57f59bf5bc5ab0a670297cb
Created May 14, 2017 04:24
power management in arch
View gist:36a35eb4d57f59bf5bc5ab0a670297cb
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
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