Skip to content

Instantly share code, notes, and snippets.

yijia yijia2413

Block or report user

Report or block yijia2413

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yijia2413
yijia2413 / mysql-to-hive.sh
Created Dec 8, 2015
use sqoop import data to hive from mysql
View mysql-to-hive.sh
#!/bin/bash
set -ex
jdbc_url='172.16.8.xxx:3306'
mysql_db='kafka_data'
mysql_user_name='kafka'
mysql_passwd='kafka'
mysql_tb='project'
hive_db='yijia'
@yijia2413
yijia2413 / setup_teamviewer.sh
Created Dec 8, 2016
无公网 ip 远程连接的折中方案
View setup_teamviewer.sh
#!/bin/bash
set -ex
yum install -y wget
wget https://download.teamviewer.com/download/teamviewer.i686.rpm
yum install teamviewer.i686.rpm -y
View get_dir_in_bash.sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
View constructor.cpp
#include<iostream>
#include<cstring>
using namespace std;
class String {
public:
String(const char *str);
String(const String &other);
~String(void);
@yijia2413
yijia2413 / unicode.py
Created Oct 13, 2017
Python unicode to Chinese
View unicode.py
# python 2.7
'\\uxxxx'.decode('unicode-escape')
# python 3.x
'\\uxxxx'.encode('ascii').decode('unicode-escape')
'\\uxxxx'.decode('unicode-escape')
View publish_redis.py
#coding: utf8
import time
import redis
from multiprocessing import Process
def pub(r, num_msg):
for i in range(num_msg):
r.publish('channel', 'offset %d' % i)
@yijia2413
yijia2413 / client.py
Last active Nov 27, 2017
socket|epoll
View client.py
#coding: utf8
import socket
import time
import multiprocessing
def socket_instance():
c = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
c.connect(('127.0.0.1', 1024))
return c
@yijia2413
yijia2413 / ss_docker.sh
Created Dec 1, 2017
ss in cloud env, using docker
View ss_docker.sh
#!/bin/bash
set -ex
PASSWD='helloworld1234'
yum update -y
yum install -y yum-utils device-mapper-persistent-data lvm2
yum install docker-ce -y
View basic.vimrc
set nu
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - amix@amix.dk
"
" Version:
" 6.0 - 01/04/17 14:24:34
"
" Blog_post:
View vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
You can’t perform that action at this time.