Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Keep smiling ;)

Abdul Hannan (Kamrul) k4mrul

😎
Keep smiling ;)
View GitHub Profile
@ayyybe
ayyybe / ccdl.command
Last active Oct 26, 2020
Adobe Offline Package Generator v0.1.2 (macOS only)
View ccdl.command
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@glof2
glof2 / spacepaper.pyw
Last active Jul 4, 2020
Sets your wallpaper to NASA's picture of the day
View spacepaper.pyw
import requests
from bs4 import BeautifulSoup
from os import path, getcwd
import ctypes
import time
def windowswallpaper(image):
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, image, 0)
@huraji
huraji / php.ini
Last active Mar 11, 2020
Optimal php.ini configuration for Wordpress, see also https://xilab.co/what-are-the-best-wordpress-php-ini-settings/
View php.ini
# Wordpress php.ini configuration
upload_max_filesize = 32M
post_max_size = 32M
memory_limit = 128M
max_execution_time = 60
max_input_vars = 10000
max_input_time = 30
@chdsbd
chdsbd / slack-dnd.md
Created Sep 16, 2018
Disable Slack notifications for the weekend
View slack-dnd.md

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
@victorpetryk
victorpetryk / mailhog-install.md
Last active Oct 7, 2020
MailHog installation on Ubuntu
View mailhog-install.md

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
View opentracing_flask.py
from flask import Flask
from flask import request
import requests
from jaeger_client import Config
from flask_opentracing import FlaskTracer
import opentracing
app = Flask(__name__)
@dusta
dusta / Deploy_on_cPanel.md
Last active Oct 26, 2020 — forked from oodavid/README.md
Deploy your site with git on cPanel
View Deploy_on_cPanel.md

Deploy your site with git on cPanel

The most important: You must have shell access!

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
@rbq
rbq / docker.yaml
Last active Oct 7, 2020
Install Docker CE on Ubuntu using Ansible
View docker.yaml
---
- 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: url=https://download.docker.com/linux/ubuntu/gpg
@akosveres
akosveres / mariadb.yml
Last active Oct 28, 2020
Mariadb + phpmyadmin docker-compose
View mariadb.yml
version: "2"
services:
db:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=test
- MYSQL_DATABASE=radio
volumes:
- ./database:/var/lib/mysql
phpmyadmin:
@lukecav
lukecav / functions.php
Last active Oct 11, 2020 — forked from eteubert/wordpress-passwort-reset-unmultisite.php
WordPress Multisite: Password Reset on a Subsite.
View functions.php
/**
* 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
You can’t perform that action at this time.