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/perl | |
use strict; | |
use List::Util qw(shuffle); | |
my $cmd = "find \"/home/music\" -type f"; | |
my @files = `$cmd`; | |
my @songs = shuffle @files; | |
open(LIST, ">", "/var/tmp/rand_playlist.m3u"); |
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 <[email protected]> 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 | |
from pypuppetdb import connect | |
import platform | |
hostname = platform.node() | |
cert = '/etc/puppetlabs/puppet/ssl/certs/%s.pem' %hostname | |
key = '/etc/puppetlabs/puppet/ssl/private_keys/%s.pem' %hostname | |
ca_cert = '/etc/puppetlabs/puppet/ssl/ca/ca_crt.pem' |
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/bash | |
# | |
# htg.sh - Happy Thanksgiving :) | |
# | |
# Requires the 'banner' package to work | |
# dnf install banner on Redhat based systems | |
echo -e "\n ,+*^^*+___+++_\n ,*^^^^ )\n _+* ^**+_\n +^ _ _++*+_+++_, )\n _+^^*+_ ( ,+*^ ^ \+_ )\n { ) ( ,( ,_+--+--, ^) ^\\n { (@) } f ,( ,+-^ __*_*_ ^^\_ ^\ )\n {:;-/ (_+*-+^^^^^+*+*<_ _++_)_ ) ) /\n ( / ( ( ,___ ^*+_+* ) < < \\n U _/ ) *--< ) ^\-----++__) ) ) )\n ( ) _(^)^^)) ) )\^^^^^))^*+/ / /\n ( / (_))_^)) ) ) ))^^^^^))^^^)__/ +^^\n ( ,/ (^))^)) ) ) ))^^^^^^^))^^) _)\n *+__+* (_))^) ) ) ))^^^^^^))^^^^^)____*^\n \ \_)^)_)) ))^^^^^^^^^^))^^^^)\n (_ ^\__^^^^^^^^^^^^))^^^^^^^)\n ^\___ |
OlderNewer