Skip to content

Instantly share code, notes, and snippets.

View LexaChebara's full-sized avatar
🏠
Working from home

Alexey LexaChebara

🏠
Working from home
View GitHub Profile

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@LexaChebara
LexaChebara / unix_shell_useful_cmd
Created March 5, 2015 09:13
Useful *NIX commands
#find file by name in jars
find . -name "*.jar" -exec sh -c 'jar -tf {}|grep -H --label {} 'org.apache.hadoop.fs.FileSystem'' \;
@LexaChebara
LexaChebara / sqoop_direct_oracle
Created March 4, 2015 18:56
Sqoop Direct Oracle mode [from Sqoop 1.4.5 (Quest)]
SELECT data_object_id,
file_id,
relative_fno,
file_batch,
MIN (start_block_id) start_block_id,
MAX (end_block_id) end_block_id,
SUM (blocks) blocks
FROM
(SELECT o.data_object_id,
e.file_id,
===Notebook Fujitsu LIFEBOOK S762===
**Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz**
====Java 7====
---- 8< (cut here) -----------------------------------------
Java(TM) SE Runtime Environment, 1.7.0_25-b15
Java HotSpot(TM) 64-Bit Server VM, 23.25-b01
Linux, 3.8.0-38-generic, amd64
@LexaChebara
LexaChebara / gist:9951340
Created April 3, 2014 09:30
График CPL (load average) по данным atop
#!/bin/sh -u
# $0 [atop logfile to plot]
log=${1-'/var/log/atop.log'}
tmp=/tmp/atop$$
rm -f $tmp
trap "rm -f $tmp" 0 1 2
atop -PCPL -r "$log" >$tmp
@LexaChebara
LexaChebara / gist:6551221
Last active December 23, 2015 00:09
Ant Jsch with non empty passphrase (jsch 1.5+)
<target name="upload">
<input message="Enter passphrase:" addproperty="ssh.passphrase" >
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<scp todir="${ssh.username}@${ssh.host}:${ssh.path}"
file="${file.to.copy}" trust="true"
keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}"/>
</target>
@LexaChebara
LexaChebara / gist:6534766
Created September 12, 2013 09:04
Quick removing of duplicate rows in Oracle table T over X, where X can be set of columns.
DELETE FROM T WHERE ROWID IN (
SELECT rid
FROM (SELECT ROWID rid, ROW_NUMBER() OVER ( PARTITION BY X ORDER BY ROWID ) rn FROM T)
WHERE rn > 1);