Skip to content

Instantly share code, notes, and snippets.

View RakibFiha's full-sized avatar
🏠
Working from home

Rakib Fiha RakibFiha

🏠
Working from home
View GitHub Profile
@RakibFiha
RakibFiha / docker
Last active February 24, 2024 06:58
docker wrapper for podman, colima and docker
#!/usr/bin/env bash
# Author: rakibfiha
# Usage: Save it to $HOME/.local/bin/docker and add this path to your $PATH
# ENV: DOCKER_RUNTIME=podman|colima-containerd; Default: colima-containerd
# For colima: colima start --runtime containerd
# For podman: podman machine init && podman machine start and set DOCKER_RUNTIME=podman
# For docker: set DOCKER_RUNTIME=full/path/to/docker/executable
runtime_exists() {
@giner
giner / configure_bash.sh
Created October 24, 2019 14:01
BASH: add some usefulness
## bash: keep longer history
sed -i 's/^HISTSIZE=1000$/HISTSIZE=10000/' ~/.bashrc
sed -i 's/^HISTFILESIZE=2000$/HISTFILESIZE=20000/' ~/.bashrc
## Enable search through history with PgUp/PgDn
cat > ~/.inputrc << 'EOF'
$include /etc/inputrc
# alternate mappings for "page up" and "page down" to search the history
"\e[5~": history-search-backward
@niw
niw / Vagrantfile
Last active February 22, 2024 10:21
A simple Vagrantfile to setup Ubuntu desktop environment with Google Chrome and Japanese input
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider :virtualbox do |v|
v.gui = true
v.memory = 2048
end
# Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"`
# to make synced folder works.
@allenday
allenday / zero-fee-bitcoin-tx.sql
Created January 25, 2019 07:39
Find zero-fee Bitcoin transactions
SELECT
ROUND((input_value - output_value)/ size, 0) AS fees_per_byte,
COUNT(*) AS txn_cnt
FROM
`bigquery-public-data.crypto_bitcoin.transactions`
WHERE TRUE
AND block_timestamp >= '2018-01-01'
AND is_coinbase IS FALSE
GROUP BY 1
# Connectiong by SSH from Android Termux to Desktop and vice-versa.md
# Copyright (c) 2019 Evandro Coan
# 
# 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,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
@atiensivu
atiensivu / GnomeShellExtensions
Created September 11, 2017 20:13
Gnome Tweak Tool - enable user themes - No such schema “org.gnome.shell.extensions.user-theme”
sudo cp $HOME/.local/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/schemas/org.gnome.shell.extensions.user-theme.gschema.xml /usr/share/glib-2.0/schemas && sudo glib-compile-schemas /usr/share/glib-2.0/schemas
# One liner fix that shouldn't be necessary
@seeebiii
seeebiii / LambdaConstants.java
Last active February 9, 2024 04:17
Available default environment variables in AWS Lambda. Just copy&paste into your Node or Java project.
public class Constants {
/**
* Contains the path to your Lambda function code.
*/
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT");
/**
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function:
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10
// find element without pair in array
def solution(A):
A.sort()
for index in range(0,len(A),2):
if A[index] != A[index+1]:
return A[index]
B = [5,6,2,9,2,3,6,7,3,1,7,9,1]
print(solution(B))
@tomysmile
tomysmile / setup-vagrant-macosx.md
Created April 26, 2016 05:54
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

@lumengxi
lumengxi / Makefile
Created March 17, 2016 16:44
Makefile for Python projects
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef