This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Run | |
brew install source-highlight | |
Presuming you are using brew, of course. | |
2) Create the file /usr/local/share/source-highlight/src-hilite-lesspipe.sh | |
with the following as its contents | |
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fib | |
@tracking = [0,1] | |
def self.iter_compute(index) | |
tracking = [0,1] | |
index.times do |i| | |
tracking << tracking[-2] + tracking[-1] | |
tracking.shift if tracking.size > 2 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- salt_cmd = "salt -L '#{key}' cmd.retcode 'export HOME=#{@home}; #{cmd} >> #{@local_log}'" | |
- unless redirect | |
- salt_cmd = "salt '#{key}' cmd.run '#{cmd}'" | |
- end | |
+ salt_cmd = redirect ? "salt -L '#{key}' cmd.retcode 'export HOME=#{@home}; #{cmd} >> #{@local_log}'" : "salt '#{key}' cmd.run '#{cmd}'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Explain as much as possible what's going on in the following real-world terminal session. | |
Guidance: | |
Tell us what Linux distros these might be by what their PS1 is or are based off. | |
What are the vars in each prompt used to produce it? | |
In ssh, why did we get an X11 error once and what does -C and -X do? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemon for Red Hat-based distributions | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
salt_cmd = if return_code | |
"salt -t #{SALT_TIMEOUT} -L --out=yaml '#{key}' cmd.retcode 'export HOME=#{@home}; #{cmd} 2>> #{@remote_log}'" | |
else | |
"salt -t #{SALT_TIMEOUT} -L --out=yaml '#{key}' cmd.run '#{cmd}'" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@ip-172-16-20-13 ~]# netstat -rn | |
Kernel IP routing table | |
Destination Gateway Genmask Flags MSS Window irtt Iface | |
169.254.255.1 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 | |
172.16.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 | |
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 | |
172.17.0.0 169.254.255.1 255.255.0.0 UG 0 0 0 tun0 | |
0.0.0.0 172.16.20.1 0.0.0.0 UG 0 0 0 eth0 | |
[root@ip-172-17-20-47 ~]# netstat -rn |