Skip to content

Instantly share code, notes, and snippets.

View abdul's full-sized avatar
🎯
Focusing

Abdul Qabiz abdul

🎯
Focusing
View GitHub Profile
@abdul
abdul / install-quake3.sh
Created May 16, 2020 08:40 — forked from simonewebdesign/install-quake3.sh
Install Quake 3: Arena on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@abdul
abdul / disqus-ondemand.html
Created May 12, 2020 07:18 — forked from robwent/disqus-ondemand.html
Loads Disqus comments on click with native JavaScript. Opens comments when linked to directly.
<div class="comments-block">
<button id="show-comments" onclick="disqus();return false;">Load Comments</button>
</div>
<div id="disqus_thread"></div>
<script>
var disqus_loaded = false;
var disqus_shortname = 'xxxx'; //Add your shortname here
@abdul
abdul / WP to Jekyll Migration Notes
Created May 12, 2020 00:55 — forked from kerim/WP to Jekyll Migration Notes
Notes on migrating Wordpress Blog to GitHub Project Pages using Jekyll and the Hyde theme
I recently migrated ( http://keywords.oxus.net/ ) from my own server to GitHub project pages using Jekyll and the Hyde theme ( https://github.com/poole/hyde ). This Gist documents some of the issues I faced and how I solved the problems.
1. I tried to follow the instructions found on these sites:
http://blog.8thcolor.com/en/2014/05/migrate-from-wordpress/
http://blog.codeinside.eu/2014/09/13/How-We-Moved-From-Wordpress-To-Jekyll-On-Windows/
http://www.nooku.org/blog/2013/03/from-wordpress-to-jekyll/
http://chadfield.org/work/how-i-migrated-wordpress-to-jekyll/
http://www.girliemac.com/blog/2013/12/27/wordpress-to-jekyll/
http://virtuallyhyper.com/2014/05/migrate-from-wordpress-to-jekyll/

Hello Aleksey,

We’d like to provide open source modular theming examples accessible on GitHub sometime in the future, but hopefully this will answer your question in the short term.

1. The Handlebars Partials File

The contents of the community-posts module’s partials.js file are as follows:

const communityPostsListItem = `
@abdul
abdul / find_and_move_duplicates.sh
Created April 20, 2020 13:46
Find duplicate files -- uses imohash for faster hashing and finding duplicates
#!/bin/bash
# Filename: find_and_move_duplicates.sh
# Description: Find and (re)move duplicate files and
# keep one sample of each file.
gls -lS --time-style=long-iso | awk 'BEGIN {
getline; getline;
name1=$8; size=$5
}
{
name2=$8;
@abdul
abdul / WireGuard-site-to-site.md
Created April 1, 2020 21:38
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@abdul
abdul / install_circuit_maker_osx.sh
Created March 10, 2020 11:25 — forked from show0k/install_circuit_maker_osx.sh
Run CircuitMaker on OSX thanks to wine and winetricks
# If Homebrew is not installed uncomment the next line
# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Wine and WineTricks
brew install wine && brew install winetricks
# Download CircuitMaker
curl https://s3.amazonaws.com/altium-install/CircuitMaker/CircuitMakerSetup.exe -o ~/Downloads/CircuitMakerSetup.exe
@abdul
abdul / gist:94120d887619eed6cb033d9705864bf8
Created July 19, 2019 18:40 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
@abdul
abdul / pci-table.md
Created June 11, 2019 23:49 — forked from cuteribs-1/pci-table.md
PCI Vendor Data Table
Vendor Id Vendor Name
0x0033 Paradyne Corp.
0x003D master
0x0070 Hauppauge Computer Works Inc.
0x0100 USBPDO-8
0x0123 General Dynamics
0x0315 SK - Electronics Co., Ltd.
0x0402 Acer aspire one
0x046D Logitech Inc.
@abdul
abdul / getethstats.js
Last active July 14, 2022 05:13
Get Ethereum Stats (using Web3.js) - current block number, block heigh (transactions count), TPS (transaction per second), average gas price
const Web3 = require("web3");
const INFURA_END_POINT = "https://mainnet.infura.io/v3/<ENTER_INFURA_API_TOKEN>"
const web3 = new Web3(new Web3.providers.HttpProvider(INFURA_END_POINT));
const getEthStats = async () => {
const gasPrice = await web3.eth.getGasPrice(); //average gas price
const currentBlock = await web3.eth.getBlock("latest");
let result = null;
if (currentBlock.number !== null) { //only when block is mined not pending
const previousBlock = await web3.eth.getBlock(currentBlock.parentHash);