Skip to content

Instantly share code, notes, and snippets.

@wahello
wahello / run_spark_cluster.sh
Created September 29, 2020 15:54 — forked from jasonrig/run_spark_cluster.sh
Example SLURM job script to start a Spark cluster
#!/bin/bash
#SBATCH --job-name spark-cluster
#SBATCH --account=qh82
#SBATCH --time=02:00:00
# --- Master resources ---
#SBATCH --nodes=1
#SBATCH --mem-per-cpu=1G
#SBATCH --cpus-per-task=1
#SBATCH --ntasks-per-node=1
# --- Worker resources ---
@wahello
wahello / job_array_demo.sh
Created September 29, 2020 15:54 — forked from andersgs/job_array_demo.sh
Slurm job arrays
#!/bin/bash
# Illustrating the use of job arrays in SLURM
# use the command: sbatch --array=1-100 job_array_demo.sh
# Partition for the job:
#SBATCH -p main
# Multithreaded (SMP) job: must run on one node
#SBATCH --nodes=1
@wahello
wahello / gist:e37cfc0a2a1416f9f0c1e6eb01a49d1f
Created August 24, 2020 02:25 — forked from creativcoder/gist:5dc5c2e35cd218ce9b5d
Get list of installed packages(apps) in android via adb shell
Issue this command to terminal with your device connected :
$ adb shell pm list packages
If that doesn't work, then:
$ adb shell
$ su
$ pm list packages
@wahello
wahello / AdbCommands
Created June 24, 2020 01:30 — forked from ernestkamara/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@wahello
wahello / simple_args_parsing.sh
Created June 16, 2020 06:17 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@wahello
wahello / test-violentmonkey.user.js
Created May 26, 2020 09:30 — forked from gera2ld/test-violentmonkey.user.js
Test Violentmonkey functions
// ==UserScript==
// @name test script
// @namespace Violentmonkey Scripts
// @icon https://cn.gravatar.com/avatar/a0ad718d86d21262ccd6ff271ece08a3?s=80
// @resource baidu https://www.baidu.com/img/baidu_jgylogo3.gif
// @resource text data:text/plain,hello,world
// @resource mochaCss https://cdn.jsdelivr.net/npm/[email protected]/mocha.min.css
// @run-at document-start
// @grant GM_getValue
// @grant GM_setValue
@wahello
wahello / For Mac 4.2.6 unlimited trial.md
Created April 10, 2019 02:15 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher,4.2.5,4.2.6 ,it's works , this is the way which makes Always in evaluation mode 。

  1. go to the dir : /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare
  4. insert BCompare the content :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@wahello
wahello / related.py
Created December 6, 2018 12:34 — forked from gcko/related.py
Django Custom Model ForeignKey Field for Spanning Databases
@wahello
wahello / mongo-dump-csv.sh
Created June 15, 2018 02:46 — forked from mderazon/mongo-dump-csv.sh
Export all of Mongodb collections as csv without the need to specify fields
OIFS=$IFS;
IFS=",";
# fill in your details here
dbname=DBNAME
user=USERNAME
pass=PASSWORD
host=HOSTNAME:PORT
# first get all collections in the database
@wahello
wahello / App.js
Created April 5, 2018 04:29 — forked from madcoda/App.js
React-router v4 multi layout
import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Link, Match, Redirect, Switch } from 'react-router-dom'
import OverviewPage from './page/OverviewPage'
import AccountPage from './page/AccountPage'
/*
Layouts, inline define here for demo purpose
you may want to define in another file instead
*/