Skip to content

Instantly share code, notes, and snippets.

@volure
Last active October 6, 2017 21:36
Show Gist options
  • Save volure/c068a382a280dcaccaf9 to your computer and use it in GitHub Desktop.
Save volure/c068a382a280dcaccaf9 to your computer and use it in GitHub Desktop.
BASH: Useful Commands
# Find Replace in files
find /path -type f -iname "*.txt" -exec sed -i.bak 's/foo/bar/g' "{}" +;
# Get a .gitignore with common ignore patterns
wget -O - https://www.gitignore.io/api/intellij,node,eclipse,visualstudio,linux,osx,windows,elasticbeanstalk > .gitignore
# Get current external ip from command line
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
# owncloud ldap config
[root@host /var/www/html/owncloud]
# sudo -u apache ./occ ldap:xx
[InvalidArgumentException]
Command "ldap:xx" is not defined.
Did you mean one of these?
ldap:search
ldap:show-remnants
ldap:check-user
ldap:delete-config
ldap:create-empty-config
ldap:set-config
ldap:test-config
ldap:show-config
# Enable Owncloud LDAP Config Panel
sudo -u apache ./occ app:enable user_ldap
sudo -u apache ./occ ldap:set-config "" ldapConfigurationActive 1
# Convert slapd.conf to slapd.d config files.
slaptest -f /inputFile/containting/slapd.conf -F /Destination/Such/As/etc/openldap/slapd.d
# Check smtp connection with STARTTLS
openssl s_client -starttls smtp -crlf -connect 1.2.3.4:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment