Archive

Archive for February, 2017

Linux: place line numbering on output of file (nl)

February 21, 2017 Leave a comment

Simple command (nl)to add line numbers to a file on the output:

$ nl /etc/passwd
1 root:x:0:0:root:/root:/bin/bash
2 daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
3 bin:x:2:2:bin:/bin:/usr/sbin/nologin
4 sys:x:3:3:sys:/dev:/usr/sbin/nologin
5 sync:x:4:65534:sync:/bin:/bin/sync
6 games:x:5:60:games:/usr/games:/usr/sbin/nologin
7 man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
8 lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
9 mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
10 news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
11 uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
12 proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
13 www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
14 backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
15 list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
16 irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
17 gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
18 nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
19 libuuid:x:100:101::/var/lib/libuuid:
20 syslog:x:101:104::/home/syslog:/bin/false
21 messagebus:x:102:106::/var/run/dbus:/bin/false
22 landscape:x:103:109::/var/lib/landscape:/bin/false
23 sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin
24 pollinate:x:105:1::/var/cache/pollinate:/bin/false
25 vagrant:x:1000:1000::/home/vagrant:/bin/bash
26 colord:x:106:112:colord colour management daemon,,,:/var/lib/colord:/bin/false
27 statd:x:107:65534::/var/lib/nfs:/bin/false
28 puppet:x:108:114:Puppet configuration management daemon,,,:/var/lib/puppet:/bin/false
29 ubuntu:x:1001:1001:Ubuntu:/home/ubuntu:/bin/bash

Advertisements
Categories: Linux, Redhat, Uncategorized

Vagrant example file

February 17, 2017 Leave a comment

# To connect to vagrant guest:
vagrant status
vagrant resume acs
vagrant ssh acs

## Begin Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The “2” in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don’t change it unless you know what
# you’re doing.
Vagrant.configure(“2”) do |config|

config.vm.define “acs” do |acs|
acs.vm.box = “ubuntu/trusty64”
acs.vm.hostname = “acs”
acs.vm.network “private_network”, ip: “192.168.33.10”
end

config.vm.define “web” do |web|
web.vm.box = “nrel/CentOS-6.5-x86_64”
web.vm.hostname = “web”
web.vm.network “private_network”, ip: “192.168.33.20”
web.vm.network “forwarded_port”, guest: 80, host: 8080
end

config.vm.define “db” do |db|
db.vm.box = “nrel/CentOS-6.5-x86_64”
db.vm.hostname = “db”
db.vm.network “private_network”, ip: “192.168.33.30”
end

end

Categories: Uncategorized