#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
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 |
#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
#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
#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:
#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
#MongoDB Indexes There are 5 different index types supported in MongoDB.
##Create Index
#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:
#JavaScript - Get Unique Elements
var test = ["Naas", "Newbridge", "Dublin", "Naas"]
> test
[ 'Naas',
'Newbridge',
'Dublin',
'Naas' ]
#Ubuntu Terminal Color
R 48
G 10
B 36
H 319
S 79
V 19