Skip to content

Instantly share code, notes, and snippets.

View jvmvl's full-sized avatar
💻
Hello World

Jamal Chahir jvmvl

💻
Hello World
  • Sixth Dimension
View GitHub Profile
@jvmvl
jvmvl / gist:7ea86a034cde2ab5040ca5255129a1c0
Created November 12, 2023 20:58
Privacy Policy for Spendings & Budget Planner
Privacy Policy for Spendings & Budget Planner
Last Updated: 12/11/2023
Thank you for choosing Spendings & Budget Planner! This Privacy Policy outlines how we collect, use, and store information when you use our mobile application.
1. Information We Collect
1.1 User-Provided Information: The Spendings & Budget Planner app does not collect any personal information from users.
1.2 Data Storage: The app uses device storage to export and/or restore CSV files containing budget and spending data entered by the user.
Replace html comments :
<!--(.*?)-->
Replace empty lines :
^(\s)*$\n
@jvmvl
jvmvl / allkeys.php
Created March 6, 2020 09:00 — forked from jcefoli/allkeys.php
List All Key/Value Pairs in Redis using the Predis Library. Assumes that Redis is running locally on default port 6379 with no password auth
<?
//Include Predis library. See https://github.com/nrk/predis for more info
require "Predis/Autoloader.php";
//Connect to Redis
Predis\Autoloader::register();
try {
$redis = new Predis\Client();
$redis = new Predis\Client(array(
"scheme" => "tcp",
@jvmvl
jvmvl / output.js
Created October 2, 2019 16:32 — forked from derhuerst/output.js
how fetch a GitHub user's stars
[
{
owner: 'bcoe',
repo: 'top-npm-users',
description: ':star: Generate a list of top npm users by based on monthly downloads.',
language: 'JavaScript',
isFork: false,
stargazers: 27,
watchers: 27
}
@jvmvl
jvmvl / mysql-dump-tables-by-prefix.txt
Created September 21, 2019 11:06 — forked from tofirius/mysql-dump-tables-by-prefix.txt
MySQL dump of tables that begin with a given prefix
mysql database_name -u username -pPassWord -N -e 'show tables like "tableprefix\_%"' | xargs mysqldump database_name --u username -pPassWord > prefixedtable_dump.sql

Keybase proof

I hereby claim:

  • I am jvmvl on github.
  • I am jamalchahir (https://keybase.io/jamalchahir) on keybase.
  • I have a public key ASAOefhSzdW0qtemV7fsvx95lxQ5Lyw0LGcZbetcG7l6ygo

To claim this, I am signing this object:

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost