Skip to content

Instantly share code, notes, and snippets.

@ekbelova
ekbelova / README_template.md
Last active January 31, 2018 10:44
template for readme.md file

Project Name

General info

Short description what it is for.

Stakeholders: for external - list departments, for internal - projects or ppl who depend. (To evaluate how critical if it goes down in production once and to inform about problems).

Input Data (if applicable):

  • name, hdfs/external path;
@ekbelova
ekbelova / oracle.sql
Last active October 1, 2023 22:18
usefull Oracle queries
SELECT * FROM V$VERSION; --get current Oracle instance version
--for Oracle 10g
--get total size in MB for current user
SELECT sum(bytes)/1024/1024 size_in_mb FROM DBA_SEGMENTS
WHERE OWNER='<user_name>';
--DBA_SEGMENTS describes the storage allocated for all segments in the database.
--related view: USER_SEGMENTS describes the storage allocated for the segments
--owned by the current user's objects.
--This view does not display the OWNER, HEADER_FILE, HEADER_BLOCK, or RELATIVE_FNO columns.
export HADOOP_USER_NAME=hdfs
hdfs dfs -du -h /
hdfs dfs -du [-h] / | sort -n[/d] -r --key=1,15 #size of files on hdfs in sorted order
hdfs dfs -expunge #empty trash bin
#read several lines from compressed file on hdfs
hdfs dfs -cat /user/hive/warehouse/test_proz_tax/part-m-00000.gz | zcat | head -n 10
@ekbelova
ekbelova / MC on Mac
Created January 11, 2018 09:21
Usefull shortkeys for midnight commander, for Mac users
----- Esc -----
Quick change directory: Esc + c
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + Option + o
Search/Go to directory in active panel: Esc + s / Ctrl + Option + s then start typing directory name
Open same working directory in the inactive panel: Esc + i
Open parent working directory in the inactive panel: Esc + o