Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar
💭
I may be slow to respond.

Md. Sumon Islam sumonst21

💭
I may be slow to respond.
View GitHub Profile
@sumonst21
sumonst21 / gist:9be1cec633f012b8ae0b6c4550de76a8
Last active February 22, 2022 08:08 — forked from n0ha/gist:636254
Find months with at least 5 Fridays, Saturdays and Sundays
import calendar
import datetime
# change timezone to GMT+6
START_YEAR = 2021
END_YEAR = 2023
@sumonst21
sumonst21 / csgo-server-guide.md
Created February 21, 2022 16:20 — forked from fanjin-z/csgo-server-guide.md
Complete Guide for Hosting CS:GO Dedicated Servers

Complete Guide for Hosting a CS:GO Dedicated Server

Creative Commons License.

I tested the setup on Debian Stretch (naive installation) and Jessie (LinuxGSM installation). The setup should work on Debian 8 (Jessie), Debian 9 (Stretch) and Ubuntu (16.04). However, If you're running on Windows or other non-debian based Linux OS (e.g. CentOS, openSUSE), this guide doesn't apply to you.

My Servers:

I'm hosting FFA warm-up and HvH(soon) servers in San Francisco, welcome to join by:

IPv4: 159.89.154.137   
Ipv6: 2604:a880:2:d0::20ad:2001 
@sumonst21
sumonst21 / wordpress-additional-files.php
Created February 11, 2022 19:38 — forked from avillegasn/wordpress-additional-files.php
How to allow uploading additional file extensions in WordPress
<?php
add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
function my_myme_types( $mime_types ) {
$mime_types['svg'] = 'image/svg+xml'; // Adding .svg extension
$mime_types['json'] = 'application/json'; // Adding .json extension
unset( $mime_types['xls'] ); // Remove .xls extension
unset( $mime_types['xlsx'] ); // Remove .xlsx extension
return $mime_types;
@sumonst21
sumonst21 / wootric.css
Created February 11, 2022 01:00 — forked from diwu1989/wootric.css
wootric css
/*
------------------------------------------
ALL WOOTRIC BEACON CSS BELOW
------------------------------------------
*/
#wootric-modal * {
/* intelligent box-model please! */
/* include padding in container sizing */
@sumonst21
sumonst21 / wget-snapshotpage.md
Created February 10, 2022 22:05 — forked from dannguyen/wget-snapshotpage.md
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

@sumonst21
sumonst21 / wget.sh
Created February 10, 2022 22:04 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@sumonst21
sumonst21 / wpmudev-defender-headers-login.php
Created February 10, 2022 20:37 — forked from wpmudev-sls/wpmudev-defender-headers-login.php
[Defender] - Add security headers on login page, useful for situation where home page getting redirected to login page
<?php
/**
* Plugin Name: [Defender] - Security header on login page
* Plugin URI: https://premium.wpmudev.org/
* Description: Add security headers on login page, useful for redirections on login page
* Author: Prashant Singh @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
* Task: SLS-2748
*/

Find large files/subdirectories in current folder

List all files and subfolders consisting of more than 1GB in contents in the current working directory:

du -h -d 1 . | grep 'G\s'

For example, in my backup copy of my old home folder:

@sumonst21
sumonst21 / FacebookDebugger.php
Created February 9, 2022 11:15 — forked from FrostyX/FacebookDebugger.php
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@sumonst21
sumonst21 / fb-debugger.php
Created February 9, 2022 09:57 — forked from mAAdhaTTah/fb-debugger.php
Facebook Post Debugger
<?php
/*
Plugin Name: Facebook Post Debugger
Version: 0.1
Plugin URI: http://jamesdigioia.com/
Description: This plugin runs the bit.ly shortlink through the Facebook debugger upon publishing.
Author: James DiGioia
Author URI: http://www.jamesdigioia.com/
*/