Skip to content

Instantly share code, notes, and snippets.

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
local_recipient_maps = $virtual_mailbox_maps
mailbox_size_limit = 0
milter_default_action = accept
mydestination = localhost
@leommoore
leommoore / linux_environment_variables.md
Last active July 2, 2023 00:42
Linux Environment Variables

#Linux Environment Variables

##Current Environment Variables You can list all the currennt environment variables using the env command.

XDG_VTNR=7
SSH_AGENT_PID=2030
XDG_SESSION_ID=c2
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/leo
@leommoore
leommoore / linux_screen.md
Last active April 22, 2018 14:09
Linux Screen

#Linux Screen Screen is a handy utility to allow multiple tabs or split screens in text based terminal. It is particularly useful for connecting over ssh. For example, you could run a long running task like compiling etc and continue working in another screen. It can be installed from:

sudo apt-get install screen

Command include:

Ctrl-a c   #Create a new terminal
Ctrl-a n   #Cycle through the terminals available

Ctrl-a d #Exit screen

@leommoore
leommoore / linux_logs.md
Last active August 29, 2015 14:02
Linux - Logs

#Linux - Logs To view the log messages in the memory queue use:

dmesg 

or dmesg | less

Most logs in Ubuntu are stored in /var/log. To access the system log use:

@leommoore
leommoore / android_studio_installing.md
Created June 9, 2014 10:27
Android Studio - Installing

#Android Studio - Installing To install android studio:

sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio
@leommoore
leommoore / mongodb_indexes.md
Last active May 31, 2018 06:59
MongoDB Indexes

#MongoDB Indexes There are 5 different index types supported in MongoDB.

  1. Regular (B-Tree) - supports indexes on a single or multiple fields
  2. Geo - supports indexing on a geographical location (useful for finding locations nearby)
  3. Text - Allows for search engine like full text searching
  4. Hashed - This is used primarily used for sharding as it evenly distributes the hashes rather than clustering them.
  5. Time to Life - This supports expiring based on a document date field

##Create Index

@leommoore
leommoore / mongodb_javascript.md
Last active October 28, 2016 02:03
MongoDB - JavaScript

#MongoDB - JavaScript Since a query may return a large number of records which is too large for the client, the find returns a cursor instead of the data. This cursor can be assigned to a variable.

var vendorCursor = db.vendors.find();

You can see the size of the cursor using:

vendorCursor.size();

You can check to see if there is more data after the current cursor point in the data set using:

@leommoore
leommoore / haversine.md
Last active May 25, 2022 11:34
Haversine - Distance between two points

Haversine - Distance between two points

// haversine
// By Nick Justice (niix)
// https://github.com/niix/haversine

var haversine = (function() {
@leommoore
leommoore / javascript_get_unique_elements.md
Created May 20, 2014 16:43
JavaScript - Get Unique Elements

#JavaScript - Get Unique Elements

var test = ["Naas", "Newbridge", "Dublin", "Naas"]

> test
[ 'Naas',
  'Newbridge',
  'Dublin',

'Naas' ]

@leommoore
leommoore / ubuntu_terminal_color.md
Created May 7, 2014 12:38
Ubuntu Terminal Color

#Ubuntu Terminal Color

R 48
G 10
B 36

H 319
S 79
V 19