Verify Permissions
diskutil verifyPermissions /
Repair Permissions
diskutil repairPermissions /
function tsv2csv() { | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: ./$0 tab-delimited-file.txt" | |
else | |
tr -d '\r' < "$1" | sed -r -e 's/\t/","/g' -e 's/^/"/g' -e 's/\s+(")/\1/g' -e 's/(\s+)?$/"/g' > "$1".csv | |
fi | |
} |
Note for Windows users on 64-bit systems | |
Progra~1 = 'Program Files' | |
Progra~2 = 'Program Files(x86)' |
# Match email address from list of Name,Email , email can be with country code domain or company domain. | |
# List of names (file names.txt) | |
Cameron Carr cameron.carr@example.com | |
Tim Burgess tim@example.us | |
Wanda Dyer wanda@example.com | |
Bella Dowd bella.dowd@example.com | |
Madeleine Mills madeleine.mills@example.us | |
grep -Eo '(\w+\.)?\w+@\w+\.[a-z]{2,3}$' names.txt |
#!/bin/bash | |
# Alex Duzsardi @aduzsardi | |
# made it more portable by using 'tr' instead of 'dos2unix' | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: ./$0 tab-delimited-file.txt" | |
else | |
tr -d '\r' < "$1" | sed -r -e 's/\t/","/g' -e 's/^/"/g' -e 's/\s+(")/\1/g' -e 's/(\s+)?$/"/g' > "$1".csv | |
fi |
<LDAP> | |
# recomanded setting for URL is your AD domain FQDN , enable TLS and set the correct TLSCACertFile | |
URL ldap://10.100.10.100 | |
# Bind DN for active directory can be | |
# a DN like CN=User01,OU=test,DC=domain,DC=lan | |
# user@DOMAIN , where DOMAIN is your ActiveDirectory NetBios domain name | |
# user@domain.lan , where domain.lan is your ActiveDirectory FQDN , this is called UPN or userPrincipalName | |
BindDN CN=User01,OU=test,DC=domain,DC=lan | |
Password P@ssw0rd | |
Timeout 15 |
# Info 'man 7 regex' | |
POSIX Basic Regular Expressions (BRE) | |
+ - ordinary char | |
? - ordinary char | |
| - ordinary char | |
\{\} - special chars | |
{} - regular chars | |
\(\) - special | |
() - regular |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; | |
# Info http://osxdaily.com/2015/11/16/howto-flush-dns-cache-os-x-elcap/ |
#!/bin/bash | |
# Se foloseste in felul urmator | |
# - trebuie sa ai o lista cu useri in LDAP unul cate unul pe linie separata | |
# - rulezi scriptul './mkhomes.sh lista_useri.txt' | |
# Scriptul trebuie rulat pe un server integrat cu LDAP , pe CDN 99.99% . | |
if [ $# -ne 1 ];then | |
echo | |
echo -e "\t\t Usage: $0 users_file.txt" | |
echo -e "\t\t user_file must contain the users one per line" |