Skip to content

Instantly share code, notes, and snippets.

View taizilongxu's full-sized avatar
😭
I may be slow to respond.

hackerxu taizilongxu

😭
I may be slow to respond.
  • Qunar
  • Beijing
View GitHub Profile
@jjromannet
jjromannet / gist:9a5ee7e480801576b68af1ed5fd8e979
Created November 10, 2021 07:44
Dockercompose config tu run MySQL 5.7 that works
version: "3.9"
services:
db:
image: mysql/mysql-server:5.7
environment:
MYSQL_DATABASE: 'db'
MYSQL_ROOT_PASSWORD: 'secret-pw'
MYSQL_ROOT_HOST: '%'
ports:
- '3306:3306'
@peterroth
peterroth / protobuf-250-on-mac.txt
Created February 18, 2021 10:01
How to install protobuf 2.5.0 on Mac (10.15.7, Catalina). brew required!
brew install automake libtool wget
wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2
tar -xvjf protobuf-2.5.0.tar.bz2
cd protobuf-2.5.0
./autogen.sh
./configure
make; make check
sudo make install
Validate the successful installation:
@tanbro
tanbro / 单机多用户 JupyterLab 环境搭建.md
Last active April 28, 2024 13:58
单机多用户 JupyterLab 环境搭建

单机多用户 JupyterLab 环境搭建

概述

在这篇短文中,我们记录了如何在使用 [Ubuntu][] 1804 LTS 操作系统的单台服务器上,建立用户隔离的 [JupyterLab][] Web 环境。

目标是:

  • 操作系统的用户可以各自不受干扰的使用独立的 [JupyterLab][]
  • 各个用户的 [Conda][] 环境可以自动的出现在 [JupyterLab][] 的 Kernel 列表中
@mustafaakin
mustafaakin / SQLTester.java
Last active March 19, 2022 16:32
Flink Streaming SQL Example
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.streaming.api.TimeCharacteristic;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.timestamps.AscendingTimestampExtractor;
import org.apache.flink.table.api.Table;
import org.apache.flink.table.api.TableEnvironment;
import org.apache.flink.table.api.java.StreamTableEnvironment;
import org.apache.flink.types.Row;
@robcowie
robcowie / delete_table_from_metastore.sql
Last active February 28, 2024 20:19
Drop a table form the hive metastore
# DELETE A TABLE IN THE HIVE METASTORE
# BE CAREFUL! BACKUP THE DB BEFORE PROCEEDING!
set @table_name = '';
SELECT @tbl_id := TBl_ID FROM TBLS WHERE TBL_NAME = @table_name;
-- Delete partition key vals
DELETE pvk
FROM PARTITION_KEY_VALS pvk
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@kevinkindom
kevinkindom / Python Socket 编程详细介绍.md
Last active May 3, 2024 17:14
Python Socket 编程详细介绍

Python Socket 编程详细介绍

Python 提供了两个基本的 socket 模块:

  • Socket 它提供了标准的BSD Socket API。
  • SocketServer 它提供了服务器重心,可以简化网络服务器的开发。

下面讲解下 Socket模块功能。

Socket 类型

@trusche
trusche / statsd.md
Last active May 2, 2019 13:05
Installing graphite and statsd on OS X Yosemite

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Graphite

Install Cairo

There's an issue with cairo 14.x that results in the axis fonts on the graphs being HUUUUUGE. Downgrading to 12.6 helps:

@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 5, 2024 00:12
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@Bouke
Bouke / gist:11261620
Last active August 3, 2023 01:46
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9