|
Written by Administrator
|
|
Thursday, 12 March 2009 05:53 |
|
 MJ12Net is a site that I use as a repository for all of my notes. Whenever I learn something new I'll post it here. I create scripts to help me automate things that would otherwise have to be done manually. I'm learning some really cool stuff so I will take time throughout my day from now on to update the site just like a wiki. Thanks for stopping by everybody.My Statcounter tells me you guys come here from all over the world. I get most of my traffic from the United States, India, Germany, the United Kingdom, and Canada in that order. I get people from all over the world. By far my most popular page is the System Administrator Interview Cheat Sheet. I am sorry to say that it is starting to get out of date. But it still has some handy stuff on it. If any of you guys are like me and want to chat please drop me a line. Thanks All, Brian |
|
Last Updated on Friday, 23 October 2009 19:37 |
|
|
Written by samba-fedora-11
|
|
Tuesday, 27 October 2009 08:01 |
- yum install samba samba-client libtalloc
- cp /etc/samba/smb.conf /etc/samba/smb.conf.orig
- vi /etc/samba/smb.conf
- [global]
; Uncomment this if you want a guest account ; guest account = nobody workgroup = MJ12NET log file = /var/log/samba-log.%m lock directory = /var/lock/samba share modes = yes
[homes] comment = Home Directories browseable = no writable = yes
[tmp] comment = Temporary file space path = /tmp read only = no public = yes - vi open-firewall-samba.sh
- #!/bin/bash
SAMBA_SERVER="192.168.10.104 " NETWORK="192.168.10.0/24" # Local area network BROADCAST="192.168.10.255" # Local area network Broadcast Address iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT iptables -A INPUT -p udp -s $NETWORK \ -d $SAMBA_SERVER -m multiport --dports \ 137,138 -j ACCEPT iptables -A INPUT -p tcp -s $NETWORK \ -d $SAMBA_SERVER -m multiport \ --dports 139,445 -j ACCEPT iptables -A INPUT -p udp -s $NETWORK \ -d $BROADCAST --dport 137 -j ACCEPT iptables -A INPUT -p udp -d \ $SAMBA_SERVER -m multiport \ --dports 137,138 -j DROP iptables -A INPUT -p tcp \ -d $SAMBA_SERVER -m multiport \ --dports 139,445 -j DROP iptables -A OUTPUT -s $SAMBA_SERVER \ -d $NETWORK -m state --state \ ESTABLISHED,RELATED -j ACCEPT - chmod +x open-firewall-samba.sh
- ./open-firewall-samba.sh
- service iptables restart
- useradd samba
- passwd samba
- smbpasswd -a samba
- chkconfig nmb on
- chkconfig smb on
- service nmb start
- service smb start
|
|
Last Updated on Thursday, 29 October 2009 02:31 |
|
|
Written by notes-for-sysadmins
|
|
Thursday, 22 October 2009 18:00 |
- Script to import latest ldif
===================== //////////////////// ===================== #!/bin/bash set -e host= uname -n read -s -p "Enter Password: " mypassword ldapsearch -x -h ldap-vip -D cn=admin,dc=netflix, \ dc=net -w $mypasswd -LL > latest.ldif service ldap stop date=`date +%Y%m%d` mv /var/lib/ldap /var/lib/ldap.$date mkdir -p /var/lib/ldap chown ldap /var/lib/ldap ldapadd -x -h $host -D cn=admin, dc=netflix, \ dc=net -w $mypasswd < latest.ldif service ldap start exit =============== /////////////// ===============
#!/usr/bin/perl
@namelist = qw(bmcarthy dwells emertz lkilgore \ dhyman jbecker blo arendich smclendon nsavage koss \ sswasey benderwick nrothstein twillerer mstern \ poeschger tsarandos slee pkirincich jmeir lbritton \ mlowe eziegler); foreach $name (@namelist) { system("tar cvf - ./$name | gzip -c > ./$name.tar.gz"); } exit;
|
|
Last Updated on Friday, 30 October 2009 15:26 |
|
Read more...
|
|
|