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
gawk -F: '{ print $1 ":" strftime("%Y%m%d",86400*$3) ":" strftime("%Y%m%d",86400*$4)}' /etc/shadow |
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
Awk one liners | |
HANDY ONE-LINERS FOR AWK 22 July 2003 | |
compiled by Eric Pement <pemente@northpark.edu> version 0.22 | |
Latest version of this file is usually at: | |
http://www.student.northpark.edu/pemente/awk/awk1line.txt | |
USAGE: |
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
------------------------------------------------------------------------- | |
HANDY ONE-LINERS FOR SED (Unix stream editor) Apr. 26, 2004 | |
compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.4 | |
Latest version of this file is usually at: | |
http://sed.sourceforge.net/sed1line.txt | |
http://www.student.northpark.edu/pemente/sed/sed1line.txt | |
This file is also available in Portuguese at: | |
http://www.lrv.ufsc.br/wmaker/sed_ptBR.html | |
FILE SPACING: |
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
Remove blank lines and comments: | |
egrep -v "^#.*" <FILE> |grep "." | |
Grep OR statement: | |
grep 'pattern1\|pattern2' filename | |
Grep OR Using -E | |
grep -E 'pattern1|pattern2' filename | |
Inverse grep (show lines that do *not* match a pattern) |
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
-----BEGIN CERTIFICATE----- | |
MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv | |
MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk | |
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF | |
eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow | |
gYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO | |
BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYD | |
VQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkq | |
hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkehUktIKVrGsDSTdxc9EZ3SZKzejfSNw | |
AHG8U9/E+ioSj0t/EFa9n3Byt2F/yUsPF6c947AEYe7/EZfH9IY+Cvo+XPmT5jR6 |
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
Facter.add("environment") do | |
setcode do | |
Facter::Util::Resolution.exec('/bin/cat /usr/local/etc/environment') | |
end | |
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
# System authorization information | |
install | |
# Use network installation | |
url --url="http://server.example.com/ftp/pub/fedora/23/Everything/x86_64/os" | |
auth --enableshadow --passalgo=sha512 | |
# Disable setup agent | |
firstboot --disable | |
# Keyboard layouts | |
keyboard --vckeymap=us --xlayouts='us' | |
# System language |
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
#!/usr/bin/python | |
def drink_beer(): | |
global caps | |
global empties | |
global full | |
caps += 1 | |
empties += 1 | |
full -= 1 | |
print "Drank full bottle.\n" |
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
#!/usr/bin/python | |
f = open("input.txt", "ro") | |
words = f.readline().split(" ") | |
f.close() | |
limit = len(max(words, key=len)) + 1 | |
for i in range(1, limit): | |
count = 0 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.collectd.collectd</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/local/sbin/collectd</string> | |
<string>-f</string> |
OlderNewer