Weer een leerrijke week. Bij een webbedrijf houdt niet alleen in dat je webtalen moet beheersen, maar soms komt er de oddjob servermanagement bij.
Nu, ik beheerde al even de server hier, maar blijkbaar leer je dus elke dag wat nieuws bij. Een van de dingen die ik geleerd heb is shell scripten, en veel trucs en tips ivm de linux shell die ik nog niet kende. Toen ik een e-book las over de shell ( die ook een introductie gaf van de meest gebruikte commando’s en gebruiken ), leerde ik onder andere de simpele commando’s zoals pwd ( print working directory ), en grep ( tekst filteren ).
Nu, deze commando’s zijn niet de meest nodige commando’s bij dagelijks serverbeheer, maar vb piping wel. Piping is het meest handige commando dat ik bijgeleerd heb. Piping gebeurt mbhv het | symbool, en laat ons toe commandos te chainen en zo output onderling te redirecten.
Een voorbeeld hiervan kan zijn als we een directory openen en alleen de bestanden willen zien met een .gz extensie. Dan kunnen we gewoon het commando ls -l | grep *.gz uitvoeren en dan krijgen we mooi een lijst voorgeschoteld met alle bestanden met een .gz extensie.
Nu komen we dan ook aan bij het andere dat ik geleerd heb, nl. shell scripten. We weten allemaal dat we php kunnen uitvoeren vanaf de commandline, en als we echt weten wat we doen, dan kunnen we ook php shell scripts creeƫren. Dit is an sich wel leuk, maar een deftig bash script werkt in mijn ogen nog altijd sneller met minder code, en dat de code een rare syntax heeft ( voor mij toch sinds ik van php af kom ), nemen we er maar bij.
Ik wil geen holy wars starten, maar het is gekend dat in de linux wereld er nogal een hevige discussie is van nano vs vi[m] vs emacs. ik ben lange tijd nano gebruiker geweest, maar ik heb gemerkt dat nano tekort schiet als men met grote scripts bezig is. Daarom dat ik eindelijk de tijd heb genomen om vi te leren. Vi is een leuk programma moet ik toegeven, eens dat je er mee leert werken toch.
Het shell script dat ik geschreven heb heeft als nut om een volledige dump te maken van een gekozen database, alle acties te loggen, en dan de dump met het log door te mailen naar een opgegeven emailadres. Er is ook een cleanup functie voorzien.
Ik heb hieruit geleerd dat shell scripts eigenlijk nog een krachtige taal zijn an sich omdat ze controlestructuren voorzien. Dat dit van niet zo een hoog niveau is dan andere talen, is te begrijpen, maar het maakt het leven toch weer dat beetje leuker. Het enige waar ik nog op vloek soms is de switch syntax die er als volgt uitziet:
while [ “$1″ != “” ]; do
case $1 in
-du | –dbuser ) shift
dbuser=$1
;;
-dp | –dbpass ) shift
dbpass=$1
;;
-ma | –mailtoaddress ) shift
mailto=$1
;;
-db | –database ) shift
database=$1
;;
-bd | –backupdir ) shift
backupdir=$1
;;
-ca | –cleanupafter ) shift
cleanupafter=true
;;
esac
shift
done
De bovenstaande code gaat een voor een alle parameters af die meegegeven werden aan het commando en bindt die aan de interne variabelen. De while samen met de switch zorgt ervoor dat de commandos niet op een vaste vollegorde moeten worden gezet.
Buiten leren shell scripten, heb ik ook aan enkele projecten meegewerkt, en weer les gegeven aan iemand die een basis site moest kunnen bouwen.
124 Responses for "The ghost in the shell"
████████►BUY CIALIS◀████████…
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲…
Abilify…
Buygeneric meds…
fosamax@actonel.now” rel=”nofollow”>.…
Buynow…
Acular@official.site” rel=”nofollow”>.…
Buynow…
Avelox@official.site” rel=”nofollow”>……
Buyno prescription…
Depakote@official.site” rel=”nofollow”>.…
Buygeneric drugs…
other names for trazodone…
Buyno prescription…
quinapril…
Buyit now…
Zocor…
Buygeneric drugs…
Vitamin B…
Buydrugs without prescription…
Eye Drops…
Buynow…
how much benadryl to take with zyrtec…
Buydrugs without prescription…
savella cheap canada…
Buyno prescription…
Synthroid@Synthroid.Synthroid” rel=”nofollow”>.…
Buynow it…
Pulmicort@Pulmicort.Pulmicort” rel=”nofollow”>..…
Buydrugs without prescription…
……
Buywithout prescription…
.…
Buyno prescription…
flexeril@gain.weight” rel=”nofollow”>.…
Buygeneric drugs…
……
Buygeneric drugs…
Purchase@Discount.Coral.Calcium” rel=”nofollow”>..…
Buyit now…
Cheap@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric meds…
Buy@Discount.Abana” rel=”nofollow”>..…
Buyno prescription…
Order@Cheap.Abana” rel=”nofollow”>..…
Buynow it…
Buy@Cheap.Abilify” rel=”nofollow”>..…
Buynow it…
Purchase@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>.…
Buynow it…
Order@Generic.Acai” rel=”nofollow”>..…
Buywithout prescription…
Order@Acai.Without.Prescription” rel=”nofollow”>……
Buynow…
Purchase@Abilify.Without.Prescription” rel=”nofollow”>..…
Buygeneric pills…
Buy@Coral.Calcium.Online” rel=”nofollow”>……
Buywithout prescription…
Buy@Cheap.Coral.Calcium” rel=”nofollow”>.…
Buydrugs without prescription…
Buy@Acai.Online” rel=”nofollow”>.…
Buyit now…
Buy@Acai.Online” rel=”nofollow”>……
Buyno prescription…
Buy@Cheap.Acai” rel=”nofollow”>.…
Buywithout prescription…
Order@Acai.Online” rel=”nofollow”>……
Buynow it…
Order@Acai.Online” rel=”nofollow”>……
Buyit now…
Order@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs…
Cheap@Acai.500mg” rel=”nofollow”>..…
Buygeneric drugs…
Order@Energy.Boost.Online” rel=”nofollow”>.…
Buygeneric drugs…
Purchase@Cheap.Energy.Boost” rel=”nofollow”>.…
Buyno prescription…
Purchase@Discount.Energy.Boost” rel=”nofollow”>.…
Buynow it…
Buy@Cheap.Accupril” rel=”nofollow”>.…
Buygeneric meds…
Purchase@Accupril.Online” rel=”nofollow”>.…
Buygeneric drugs…
Buy@Aciphex.Online” rel=”nofollow”>.…
Buygeneric pills…
Buy@Cheap.Aciphex” rel=”nofollow”>.…
Buygeneric meds…
Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>.…
Buyno prescription…
Cheap@Actonel.Without.Prescription” rel=”nofollow”>……
Buynow it mou…
Purchase@Generic.Actonel.35mg” rel=”nofollow”>..…
Buygeneric drugs krg…
Buy@Cheap.Actoplus.Met” rel=”nofollow”>..…
Buygeneric meds qmo…
Order@Actos.Online” rel=”nofollow”>..…
Buygeneric pills zdg…
Purchase@Generic.Actos” rel=”nofollow”>.…
Buygeneric drugs zfk…
Order@Cheap.Adalat” rel=”nofollow”>..…
Buygeneric drugs lzt…
Buy@Advair.Online” rel=”nofollow”>..…
Buynow it vhx…
Order@Discount.Coral.Calcium” rel=”nofollow”>..…
Buywithout prescription dyo…
Buy@Generic.Abilify.Without.Prescription” rel=”nofollow”>..…
Buynow it tly…
Buy@Generic.Acai” rel=”nofollow”>.…
Buygeneric drugs mby…
Buy@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs itj…
Cheap@Generic.Acai” rel=”nofollow”>……
Buydrugs without prescription vrg…
Buy@Energy.Boost.Online” rel=”nofollow”>..…
Buynow it cey…
Order@Cheap.Energy.Boost” rel=”nofollow”>..…
Buyno prescription wkp…
Order@Discount.Energy.Boost” rel=”nofollow”>..…
Buyno prescription gdt…
Purchase@Energy.Boost.Online” rel=”nofollow”>..…
Buydrugs without prescription faj…
accupril@and.muscle.pain” rel=”nofollow”>……
Buynow it zdg…
Get@Accupril.Online” rel=”nofollow”>..…
Buyit now irl…
Buy@Cheap.Aciphex” rel=”nofollow”>……
Buywithout prescription ccw…
Purchase@Discount.Aciphex” rel=”nofollow”>..…
Buyno prescription jui…
Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>……
Buyit now knc…
Buy@Actonel.Online” rel=”nofollow”>..…
Buydrugs without prescription hak…
Order@Cheap.Actonel” rel=”nofollow”>.…
Buygeneric drugs nih…
Purchase@Actonel.Online” rel=”nofollow”>……
Buygeneric drugs vbr…
Purchase@Cheap.Actonel” rel=”nofollow”>.…
Buydrugs without prescription xab…
Buy@Generic.Actonel.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs ouw…
Buy@Cheap.Advair” rel=”nofollow”>.…
Buygeneric drugs hwi…
Order@Discount.Advair” rel=”nofollow”>..…
Buyno prescription tao…
Purchase@Advair.Online” rel=”nofollow”>..…
Buyno prescription jui…
Purchase@Generic.Advair” rel=”nofollow”>.…
Buynow it lmg…
Buy@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>..< …
Buyno prescription lka…
Order@Aggrenox.Online” rel=”nofollow”>……
Buyit now sge…
Get@Aggrenox.Online” rel=”nofollow”>……
Buynow fjl…
Order@Cheap.Albenza” rel=”nofollow”>……
Buynow it sxk…
aciphex@cancer.buy” rel=”nofollow”>..…
Buygeneric drugs…
risperdal@vs.abilify” rel=”nofollow”>.…
Buygeneric drugs…
can@you.get.acai.berries.in.the.grocery.store” rel=”nofollow”>.…
Buydrugs without prescription…
allegra@generic.purchase” rel=”nofollow”>……
Buynow…
..…
Buyit now…
buy@real.strong.armour” rel=”nofollow”>.…
Buydrugs without prescription…
……
Search music now US Charts…
sleep aids and half-life…
Buy_it now…
mike divorce cancer tiffany…
Buy_generic pills…
adhd drugs causing hallucinations…
Buy_generic meds…
boulder valley asthma and allergy clinic…
Buy_no prescription…
number of obese in this generation…
Buy_generic meds…
aspirin pain relief dog…
Buy_drugs without prescription…
drug alcohol prevention resilience…
Buy_it now…
red wine and lipitor…
Buy_no prescription…
follistim increase estradiol levels…
Buy_generic drugs…
serotonin natural sources…
Buy_generic meds…
effexor xr 75…
Buy_generic pills…
genital erection…
Buy_now it…
low fat diets history…
Buy_drugs without prescription…
nursing drug study website…
Buy_drugs without prescription…
planar warts…
Buy_drugs without prescription…
hives rash from coming off prednisone…
Buy_generic drugs…
what is metoprolol succinate used for…
Buy_it now…
stop smoking phlegm…
Buy_drugs without prescription…
zocor and ms…
Buy_it now…
adderall then tylenol pm…
Buy_generic drugs…
abdominal pain lutenizing hormone…
Buy_generic drugs…
ic tramadol hcl 50 mg…
Buy_generic meds…
asthmatic inhaller mask for children…
Buy_it now…
what foods anorexia eat…
Buy_drugs without prescription…
hot dog hospital diet substitutions…
Buy_generic drugs…
nexium pepsin ac…
Buy_generic drugs…
allergic reaction to topical miconazole…
Buy_generic meds…
will the recession become a depression…
Buy_without prescription…
teen girl 16 18.6 bmi…
Buy_generic drugs…
twin pregnancy obstetrician specialist dallas…
Buy_drugs without prescription…
synephrine hcl diet pills…
Buy_generic pills…
psychotic depression and philadelphia…
Buy_generic meds…
shampoo for people with dog allergies…
Buy_now…
terry abbot…
Buy_generic drugs…
menopause thyroid cancer…
Buy_without prescription…
boniva and bone thinning and breaks…
Buy_now it…
macon georgia drug court…
Buy_without prescription…
canadian@pharmacy.valtrex” rel=”nofollow”>……
Buygeneric meds…
Leave a reply