Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Eric Luo lxneng

🎯
Focusing
View GitHub Profile
View sidekiq_cheat_sheet.md
@lxneng
lxneng / mysql-big-deletes.py
Last active Aug 24, 2021
Delete millions of rows from MySQL/TiDB
View mysql-big-deletes.py
import os
import pymysql
if __name__ == '__main__':
ret = 1
conn = pymysql.connect(
host='tidb-cluster.dm',
port=4000,
user='dm',
View install-azkaban.md
@lxneng
lxneng / LearnGoIn5mins.md
Created Jan 15, 2021 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
View LearnGoIn5mins.md
@lxneng
lxneng / StreamCatsToHBase.py
Created Aug 20, 2020 — forked from MallikarjunaG/StreamCatsToHBase.py
PySpark HBase and Spark Streaming: Save RDDs to HBase - http://cjcroix.blogspot.in/
View StreamCatsToHBase.py
1: import sys
2: import json
3: from pyspark import SparkContext
4: from pyspark.streaming import StreamingContext
5:
6:
7: def SaveRecord(rdd):
8: host = 'sparkmaster.example.com'
9: table = 'cats'
10: keyConv = "org.apache.spark.examples.pythonconverters.StringToImmutableBytesWritableConverter"
@lxneng
lxneng / gist:9b0a1585e7e41c9fae067718024d1717
Created Apr 3, 2020 — forked from Frozenfire92/gist:3627e38dc47ca581d6d024c14c1cf4a9
Install Scala and SBT using apt-get on Ubuntu 16.04 or any Debian derivative using apt-get
View gist:9b0a1585e7e41c9fae067718024d1717
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget http://scala-lang.org/files/archive/scala-2.12.1.deb
sudo dpkg -i scala-2.12.1.deb
sudo apt-get update
sudo apt-get install scala
@lxneng
lxneng / disable.sh
Created Dec 20, 2019 — forked from junkblocker/disable.sh
Disable bunch of #$!@ in Catalina
View disable.sh
#!/bin/bash
if [[ "$(sw_vers -productVersion)" != 10\.15* ]]; then
echo "This is only meant to run on macOS 10.15.* Catalina" >&2
exit 1
fi
reply=
printf "Are you pretty damn sure you want to run this? (Yes/No) "
read -r reply
[[ $reply != Yes ]] && exit 1
@lxneng
lxneng / disable.sh
Created Dec 20, 2019
Disable bunch of #$!@ in Catalina
View disable.sh
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
View wordcloud.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.