Skip to content

Instantly share code, notes, and snippets.

View Frechet's full-sized avatar

Victor Borovlev Frechet

  • Russian
View GitHub Profile
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL
);
CREATE TABLE conversations (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
@gschmutz
gschmutz / docker-compose.yml
Last active September 13, 2022 15:37
Kafka Broker with Schema Registry, Kafka Connect, Control Center, PostgreSQL, UIs, HDFS, Hue ....
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:3.3.0
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
@tjworks
tjworks / gist:31688d7e93f4d563ae1d60fc35a11b76
Last active September 28, 2022 10:36
Maven Shade to create spark worker/driver fatjars
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>spark-demo</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>spark-demo</name>
<url>http://maven.apache.org</url>
<dependencies>
If you’ve set up Hadoop for development you may be wondering why you can’t read or write files or create MapReduce jobs then you’re probably missing a tiny bit of configuration. For most development systems in pseudo-distributed mode it’s easiest to disable permissions altogether. This means that any user, not just the “hdfs” user, can do anything they want to HDFS so do not do this in production unless you have a very good reason.
If that’s the case and you really want to disable permissions just add this snippet into your hdfs-site.xml file (located in /etc/hadoop-0.20/conf.empty/hdfs-site.xml on Debian Squeeze) in the configuration section:
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
Then restart Hadoop (su to the “hdfs” user and run bin/stop-all.sh then bin/start-all.sh) and try putting a file again. You should now be able to read/write with no restrictions.
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs