Skip to content

Instantly share code, notes, and snippets.

View k4mrul's full-sized avatar
😎
Keep smiling ;)

Abdul Hannan Kamrul k4mrul

😎
Keep smiling ;)
View GitHub Profile
@viktorpetryk
viktorpetryk / mailhog-install.md
Last active January 27, 2023 09:08
MailHog installation on Ubuntu

Install & Configure MailHog

  1. Download and make it executable
wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
sudo chmod +x /usr/local/bin/mailhog
  1. Make MailHog as a service
@stephenharris
stephenharris / copy-pre.css
Last active May 8, 2023 06:46
Adding a 'copy' button to <pre> content
.pre-wrapper{
position:relative;
}
.pre-wrapper pre{
padding-top: 25px;
}
.pre-wrapper .copy-snippet {
border-radius: 0;
min-width:55px;
background: none repeat scroll 0 0 transparent;
@lrhache
lrhache / python-selenium-open-tab.md
Last active June 10, 2023 13:49
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@meilinger
meilinger / logstash-filebeat-5-minutes.md
Last active June 26, 2023 12:03
Logstash and Filebeat in 5 minutes

Logstash and Filebeat in 5 minutes

What/Why?

  • Filebeat is a log shipper, capture files and send to Logstash for processing and eventual indexing in Elasticsearch
  • Logstash is a heavy swiss army knife when it comes to log capture/processing
  • Centralized logging, necessarily for deployments with > 1 server
  • Super-easy to get setup, a little trickier to configure
  • Captured data is easy to visualize with Kibana
  • Wny not just Logstash (ELK is so hot right now)?
@chdsbd
chdsbd / slack-dnd.md
Created September 16, 2018 04:15
Disable Slack notifications for the weekend

Disable Slack notifications for the weekend

There isn't a way to configure DND for the weekend on Slack. However, you can use the /dnd 24 hours command to disable notifications for 24 hours using the [undocumented API][api] and [legacy tokens][token]. We're going to use the undocumented api and IFTTT to automate this.

Steps

  1. Generate a [token] for your account
  2. Navigate to your personal DM and copy the url (e.g. DAYM93S0N from acme.slack.com/messages/DAYM93S0N/convo/GBG661YR2-1536698414.000100/)
  3. Update the following url with your information (TOKEN looks like xoxp-4030334043-4959593942-3030320302032-sdf23rfasdf23rsf and CHANNEL looks like DAYM93S0N)
    https://slack.com/api/chat.command?token=xoxp-4030334043-4959593942-3030320302032-sdf23rfasdf23rsf&channel=DAYM93S0N&command=%2Fdnd&text=24%20hours
@rbq
rbq / docker.yaml
Last active October 19, 2023 11:57
Install Docker CE on Ubuntu using Ansible
---
- hosts: all
tasks:
- name: Install prerequisites for Docker repository
apt:
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg2', 'software-properties-common']
update_cache: yes
- name: Add Docker GPG key
apt_key:
@lukecav
lukecav / functions.php
Last active November 15, 2023 18:36 — forked from eteubert/wordpress-passwort-reset-unmultisite.php
WordPress Multisite: Password Reset on a Subsite.
/**
* Password reset on sub site (1 of 4)
* Replace login page "Lost Password?" urls.
*
* @param string $lostpassword_url The URL for retrieving a lost password.
* @param string $redirect The path to redirect to.
*
* @return string
*
* @since 1.0.0
@mmathys
mmathys / vimeo-vod.md
Last active December 13, 2023 19:19
Download Vimeo VOD (video on demand)

How to download vimeo VOD for offline usage

Variant 1

Use youtube-dl directly to download the video (thanks @meepybub!) Example:

youtube-dl -u <youremailaddress@example.com> "https://vimeo.com/ondemand/<video>"
@efernandesng
efernandesng / reset_teamviewer.sh
Last active January 9, 2024 19:38
Remove "Commercial use suspected"/"Commercial use detected" warning on teamviewer 13
#!/bin/bash
##
# Remove "Commercial use suspected"/"Commercial use detected" warning on teamviewer 13
#
# Tested on Arch linux
##
CONFIG_FILE=/opt/teamviewer/config/global.conf
@manoj23
manoj23 / ubuntu-on-archlinux-using-lxc.md
Last active January 26, 2024 01:22
Install Ubuntu containers on Archlinux using LXC

Install Ubuntu containers on Archlinux using LXC

Install the lxc and the debootstrap packages:

# pacman -Sy lxc debootstrap 

Install an Ubuntu container

I will install Ubuntu 16. Therfore, I will use the xenial release.