Jump to content
xisto Community

miCRoSCoPiC^eaRthLinG

Members
  • Content Count

    2,482
  • Joined

  • Last visited

Everything posted by miCRoSCoPiC^eaRthLinG

  1. Hi, Today we are going to learn a bit about *NIX command chmod or "change mode" - which could be referred to as the *NIX counterpart of the MS-DOS/Windows attrib command. Our objective here is to understand the way File Permissions work on *NIX systems and be able to srt/change file permissions according to our needs. Recently there have been a lot of questions flyig around about viruses on *NIX systems - so along with this I'll briefly try to explain HOW the *NIX file permissions make it so hard for viruses to operate successfully in such an environment. We'll start by setting the stage for our experiments. First we're going to setup three test users - two belonging to the same group and one as a separate user with a group of his own. Lets get to it then...Create the users with common group first. First login as root and execute the following commands. =-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-= shell> groupadd commongroup shell> adduser -g commongroup testuser1 shell> adduser -g commongroup testuser2 shell> groupadd outsidegroup shell> adduser -g outsidegroup testuser3 =-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-= The commands above are to be typed into a *NIX console. They shouldn't be to hard to decipher. The groupadd command simply creates a group named as the following parameter. Thus on the 1st and 4th line - we create two groups namely, commongroup and outsidegroup. The 2nd and 3rd line, greates two users with the login names as testuser1 and testuser2 and adds both of them to the group named commongroup (the -g <groupname> option of adduser instructs the system to create a new user and add him to the specified group directly). The 5th line again, creates yet a third user but add's him to the group named "outsidegroup". Now you've to create passwords for each of these inidividual users. That can be done by using the passwd <username> syntax. Enter "pass1" as the password for the first user - or whatever password you feel like. As you can see below, the password "pass1" was regarded as a weak/bad password for the system and it reports back to you with a warning message. But since this is just for the heck of our understanding we'll go ahead and keep the same password. =-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-= shell> passwd testuser1 Changing password for user testuser1. New UNIX password: BAD PASSWORD: it is too short Retype new UNIX password: passwd: all authentication tokens updated successfully. =-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-= Now repeat the same another two times, replacing testuser1 with the other usernames (testuser2 & testuser3). Set the passwords to whatever you feel like. Right, now that we've got the stage set lets proceed to some actual chmod-ding and get a feel of what it does and what it can do... First we are going to get a directory listing in both Windows/DOS and *NIX and compare them. Since by default the dir command in Windows doesn't spit out the file attributes, we'll simply use the "attrib" command on any directory to get us the required information. On a *NIX system, you can achieve this by typing "ls -l" ... Here's a table showing the comparative listing as I got on my windows machine on C:\ drive and on the "root" folder of a Linux system. All that gibberish (drwx--x-r-x) that you see in front of each of the *NIX files/folders are the file permissions - when constrasted to the Windows based file permission, we can see that Windows files can have at the most 4 file attributes agains the set of 10 attributes of *NIX. On a windows system, you can at the most make a file of the types - Hidden, System, Readonly and Archived. None of the attributes do much in the way of protecting a file except the ReadOnly attribute. You can easily overwrite a file with both the Hidden & System attributes set - without a hitch. Only if ReadOnly is combined with these two - you might face a "little" difficulty. I'm saying little, because all you need to do is to turn off the ReadOnly attrib and write over the file. There's no "secure" process guarding your filesystem and the file attributes - anybody or anything can do so. Even a really lame virus can use the attrib command to manipulate files and do what it wishes with them. In constrast, the *NIX attribs are grouped into 3 sets of similar attributes - these groups are named: a. User b. Group c. World - each group containing a set of 3 attributes: Read = r, Write = w & Execute = x. From this perspective, lets take a look at a set of sample attributes - all of which are turned on. The 10th attribute, which appears right at the beginning of the attrib list is d which specifies that the file is a directory/folder instead. All single files will have the "d" attribute turned off whereas, all directories will have the "d" turned on. The "d" attrib is usually tuned on ONLY when you create a directory with the md OR mkdir command. The Read/Write attributes can be compared with the presence and absence of the ReadOnly attrib on the Windows system. What's extra here is the execute attribute - which explicitly determines if a file (even if it is an executable binary comparable with the Windows .com and .exe files) can be RUN or NOT. As to WHO gets to Read/Write/Execute these files or files in certain folders, is determined by the 3groups of rwx attributes. That's where they come into play. A little explanation here.. The User set of attributes specify the activities that the user/creator of the file can perform on it - whether he can read/write/execute that file.. Any missing attribute is shown with a "-" sign in its place. Hence, if a file were to have, -r-------- it would mean that the owner/creator of the file can ONLY READ the file and not be able to write on it or execute it. Similarly, for both READ & WRITE permissions, the attrib list would take this form: -rw-------. Note that this limits the user to only Reading & Writing to the file. However, to be able to execute the file the third executable attrib has to be turned on: -rwx------. Note that we've left the file permissions for Group & World blank - which means any other user belonging to your group (recall how we created testuser1 & 2 and added them to commongroup) - won't have ANY ACCESS whatsoever to your file and you maintain strict read/write/execute permissions on the file all by yourself... Similarly, you can set any of the three permissions on for your Group in order to give a certain set of access to this file. Say if you want your group members to be able to ONLY READ the file but not be able to MODIFY or EXECUTE it, the permission set would look like: -rwxr-----. If on the other hand you want all members of your group as well as the rest of the world to do the same then it would be: -rwxr--r--. Do you begin to get the general picture how it works on *NIX ? Note, to *NIX, directories are just a special kind of file. In order to allow someone to 'traverse' the directory tree, the user has to have eXecute permissions on the directory even if they have read/write privileges set. Lets do some actual chmod-ding now.. Login as any of the users with the commongroup and create a couple of blank files with the touch command. Example: =-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-= shell> touch file1 file2 =-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-= This creates two 0 byte files with names, file1 & file2 with the default permissions set to -rw-rw-r-- . As you can see that in none of the three groups the EXECUTABLE permission is set by default. YOU as the owner/creator can read/write the file and so can members of your own group. The rest of the world can just read it. NONE of you can execute it though... Hence, if you were to receive a virus as an attachment with your email and you saved it to your home folder, as a file newly created - it would have just those two read & write permissions. Without the execution rights, the virus can hardly do anything but to lie idle in your folder. Only if you are negligent enough to give it execution rights and then execute it - it'll be able to do some damage to your home folder only... Other users of your group aren't affected by it coz this file doesn't have the necessary permissions to do/run anything in their home folders or as a matter of fact for anybody in the World group - which would mean all of US... Good news aay ?? Here's how you change your attributes. In Windows you'd have simply done attrib +/-arsh filename. Here we do a chmod +xxx filename instead. The x-s each represent a permission for YOU, YOUR GROUP & the WORLD respectively. Each x can take up a number from 0 to 7. So how do you figure which number to use to get a desired group of permissions ?? Take a look at the following table. The numbers can be: 0 = Nothing 1 = Execute 2 = Write 3 = Execute & Write (2 + 1) 4 = Read 5 = Execute & Read (4 + 1) 6 = Read & Write (4 + 2) 7 = Execute & Read & Write (4 + 2 + 1) Thus, doing a chmod +777 file1 would render file1 with the attribute set -rwxrwxrwx: Read/Write/Execute by You, Group and World or, chmod +744 file1 would change it to -rwxr--r--: Read/Write/Execute by YOU and Only Read by Group & World To make a file readable and writable by you, and only read for your group, and no access from the world, change it to chmod 640 file1. Try experimenting with the different values and do a directory listing every time to see how the attribute sets were modified. Also keep in mind that chmod -R +xxx directoryname would recursively set the same permissions to all files/sub-directories under the primary "directoryname". If you do a simple, chmod +xxx directoryname it would just set those permissions for the directory itself - but not for any of the files/folders contained therein. I shall put a stop here and carry on in the next part about how to further demystify chmod by using a set of letters (ugoa) instead of the numbers we've used here - to achieve the same thing. Also we'll log into the different user accounts we created and see how the file permissions affect the usability of the file from each users perspective. Feel free to fool around as much as you want.. it's fun in a geeky way to try various combinations of these numbers to get your desired permission set. Also next we'll deal with some of the common problems faced with file permissions when one file (say, script) tries to read from another file in the same directory or a file in another dir owned by someone else... Till then, HAPPY CHMOD-ding..All the best P.S. I chalked this one up pretty quick - please let me know if any part sounds confusing and I'll try to clarify it. Thanks...
  2. I don't think you can unless you are a moderator. For me, I get presented with an option of selecting messages by bulk - whether they belong to one user, or multiple users and am able to merge all the posts together into one big post... But I don't think this is possible for a normal user... In case you want your posts merged you've to get in touch with one of the mods/admins.
  3. Yup.. the locate db should ideally contain a complete list of files of all the hosted sites.. even though a normal user wouldn't be able to get the complete listing using locate... maybe if you create a user with locate executtion privileges and cut out the rest of the system privs - it could be run on a shared hosting system... but then again i dont know if any admin would be ready to do it.. it's almost a gaping security hole that you're setting up by opening the whole directory structure to the world. Think you should be able to come up with some workaround though..
  4. Thats the funny part - people always talk about overclocking AMD's but I've had extremely bad experiences with them.. Most of the times, overclocking (even with terrific cooling arrangements) results in complete system freeze on AMDs (at least for me).. besides there's this friend of mine - got himself an AMD cpu around 2.4Ghz.. don't remember the exact speed - but he could never run it beyond 1.5Ghz in a non-aircon environment and even with aircon it never went beyond 1.8Ghz.. what was the use of buying a 2.4 then ?? Till date he keeps on cursing amd for such a waste of money & time..
  5. I've been using this sw called WinPopupGold and it has almost all the features you're looking for... All you need to specify is the windows workgroup/domain that your network hosts are sharing and that's it - all other systems become visible to you and you can send them instant messages. Of course the other systems should have a copy of this sw running too... it loads of windows load and sits silently in your system tray till you receive a message or want to send one...Can get the trial version here at: http://forums.xisto.com/no_longer_exists/ If you want the full version.. errr.. search around - am sure you'll find loads of sites offering them Some other free LAN IMs: 1. http://forums.xisto.com/no_longer_exists/ 2. http://forums.xisto.com/no_longer_exists/
  6. Totally agree with that.. First of all, none of us came in here knowing all we could about a particular subject. Most of us shared whatever little we knew and learnt a lot more in exchange... Every person has his/her own area of specialization -whatever might it be... If you hang around for a few days, browse the posts and try to reply to some - you'll soon discover that there IS indeed something that you know a lot more about than others - and that's where you make your move in i say stay back dude - get yourself involved with this community & have loads of fun in here.... It's not necessary for you to be a good poster - you are still more than welcome to be in here... As for your hosting - that's a different matter altogether.. that's where all the good post counts come in handy.. but as Trekkie pointed out - stay in here for a while and you'll surely come up with some good ones on your own... All the best
  7. Is it possible anyhow by using a combination of the "locate/slocate" command with grep ??? Might be worth a try.. locate & slocate do exactly what the indexing service in windows does... it creates a db of filenames/folders using the command "updatedb" and helps you find out files... and grep of course, is a regular pattern/expression matcher for files.. umm... I don't see any reason why it can't be done...though I'm not sure how. I'm pretty new to php myself.
  8. Yeah.. those shutdown buttons are nasty and always get into your way. I've tried so many different types of keyboards and have generally come to hate the ones with those shutdown/mail/search/program launcher buttons.. They are more of a hindrance than being of any advantage. I mean with those kbs, everytime I tried to do a PrintScreen or Break/Pause I've invariably landed up pressing the shutdown - with of course disastrous results in the middle of some important work. Darned thing doesn't even stop to warn you.. Call me an old timer if you will - but I still think those old 102 key layout keyboards are still the best.. specially the clicky ones - coz they last like hell and extremely sturdy - besides providing you with that enjoyable clicky, springy feeling every time you hit a key...
  9. Naah not really.. the figures are all fine. The whole setup worked on the basic assumption that all these homes wouldn't be connected at the same time and/or wouldn't indulge in some heavy downloading all at the same time. Call it a miracle or a stupid assumption turned right - but the damned thing worked pretty good....lol.. I mean I can't complain - coz my computer hardly ever went off and I'd these GB's upon GB's of downloads going on all the time... It was probably me who ate away half the bandwidth they had..lol.. The situations much better now I hear - don't know from first hand experience coz I've been out of India for 4 years now... From what I hear they've upgraded the lines to 3-4 times the original backbone.. So there..
  10. Yep very much - get yourself SAMBA for Mac ( https://www.samba.org/ ) and that's it..I setup it up without a hitch in my old school labs.. Or else there are loads of p2p tools for mac and windows - with which you can achieve the same in effect... but nothing like the browsable, writeable folders that SAMBA provides
  11. Oh ho ho.. firedoor.. you're right after my heart Dude, I used to spend weeks-after-weeks just sitting in front of my system with those games... Love all of them to death... Just a few days back I was searching for them and managed to get some off the XTCAbandonware site.. but am still looking for the Indy full version.. all I'm left with (after my old system crashed) - is the stupid demo I've all version of monkey island, dott, sam n max, grim f - and my all time best series - the Hero's Quest or Quest for Glory Series from Sierra.... Police Quest, King's Quest not to be forgotten too That was ONE HAPPY & Sweet gaming time man...
  12. Don't think so - at least in the present version, although you might get a plugin for it very soon. Do you know though, that the "Quick Launch" icon that you see in your system tray eats up a good bit of your free RAM ?? That's how it does the quick launch - by keeping a good part of the code already loaded into the RAM - when you click on quick launch - it just firs up the interface. Hence, the load time is so low.. Whereas, Mozilla does this by the quick launch way, MS with their @%^$^# IE does the same too - but by integrating most of the IE code into the GUI - so it's already 80% preloaded as soon as you boot into Windows... that says a FAT lot about why IE starts up so fast...
  13. Absolutely not - they're falling back to their "Standard Procedure" again i.e. Bully you to death till you agree to use ONLY MS Products..I'm waiting anxiously for the day when all this *hit is going to spin right back to them and spell their death knell...
  14. Hey OpaQue,The SSH access ain't working anymore. Say's it doesn't like me anymore and refuses to let me in
  15. Thanks to all of you for your great contributions, especially Silent_Soul_X, Xevian & SingleDaddyof2 who hold the credits for the first and foremost submissions to get the list rolling and gave it, it's present shape. Presently I'm in the act of combining all these links together... Drop by sometime soon - it'll be ready and pinned to the top of this section As for the rest, the list is still open for your cool submissions... Thanks again... Came back to add in more. ndhill had already started a similar thread in another forum earlier. He kindly gave me permission to merge his post with my and come up with even a bigger list. You'll find lots of other useful links in his post - both by him and others.. Since those posts were made earlier than mine, I've moved them up at the top of the list... This list is getting to be really cool.. It's still open for more such great contributions... Thanks to all of you for making it a big success... Cheers
  16. HI all, This is what my plan is... We've got hundreds of posts on good graphics and design site links all spread across multiple posts, some of which just age out and fall to the bottom of the list and then there are reposts on the same topic again. My plan is to come up with some such good lists with contributions from all of you. But instead of having the links spread across multiple posts or replies to this topic, I'll merge your posts into ONE BIG POST with all the links presented serially - making it much easier for our readers to find out...as well as avoid unnecessary repeat posts on the same topic every second day. FLIP SIDE: Your post with the links won't exist as a separate post in your name - but will get merged with this post I'm making in here... BUT, I'll make sure that DUE CREDITS are provided beside every contributed link (name of the member, date posted etc). Besides we'll have someone to check the validity of these links on a regular basis and make sure that the removal all dead links happen on time... Anyone whos up for this - start posting away here with all your might Those who have posted groups of good links earlier in other posts are also welcome to contribute them in here again, as this is going to be ONE BIG COMBINED & COMPREHENSIVE LIST... Look at it this way - you'll never have to carry out extensive search on all the forums or wade through thousands of posts to find the links that you need the most - imagine the amount of time and trouble it's going to save you up on. Before you post though, make sure you understand the rules.. Read above. Looking forward to your contributions...I'm going to PIN this topic, only after I manage to get some good contributions from all of you and have a decent enough list ready... So am counting on all of you... Cheers I also found this similar post by Noel. He kindly gave me permission to merge his post with mine. P.S. I'm going to try start maintaining such lists in all the forums where it's applicable.... Help me out here... ----------------------------------------------------------------------------------- Here are the Links... Link(s) submitted by ndhill Link(s) submitted by szupie Link(s) submitted by firedoor Link(s) submitted by overture Link(s) submitted by Silent Soul X on 17th February, 2005 Link(s) submitted by Xevian on 17th February, 2005 Link(s) submitted by SingleDaddyof2 on 17th February, 2005
  17. Well am not working for them in the strictest sense - but yeah I'm helping out in this forum and also helping in moderation of the posts, in exchange of the excellent free hosting they provide.... You could call the internet unlimited in a sense - as long we don't run out of address space (IPv4), we can have theoretically, 255,255,255,255 users connecting simultaneously with the ability to share whatever data there is on their hard drives... Assuming that the average user has at least 20GB of HDD Space with data that they are willing to share - that brings us to: 5,105,105,105,100 GB of data sprawled over a massive worldwide network... pretty astounding figure I must say.. But I say theoretically because, a big part of this address space (10.x.x.x and 192.x.x.x) region is reserved for private network IPs... But then again with the gradual implementation of IPv6 that's currently happening, eventually we'll have 1,000,000 times more computers than now - connecting to the net... Imagine the amount of shared data on such a network.. would you call it anything short of unlimited ?? I mean can you ever think of downloading all that data in your lifetime or in several ???
  18. Are you sure that's the right link ? I'm getting a 404 everytime I try. Or maybe their server's down for a while too - but that wouldn't give me a 404 !! Will probably result in a connect timeout. Ok. I just went to their site and this link worked: http://chatter.flooble.com/xanga.php - though I didn't find the link straight out - came upon it through successive browsing...
  19. When I was back in India - I used to get my connection over cable lines (same as the cable tv lines). Their backbone was 512Kbps split over 100 homes I think. That left us with very little individual bandwidth - but even then it was at least 10 times faster than dialups and on 24/7. Never had to worry abou disconnecion and broken downloads. Hardly needed a download manager plus immense speed gains at night. Price was around INR 600 per month i.e. around $ 15.00 per month....which I believe was quite decent.
  20. That - I've no idea about If the revenue generated across all these sites is good enough - the network either expands or more investment is done into better servers & software.. either way - it absolutely depends on the decision makers in this company..
  21. Astahost an Xisto - both are like sister sites - both of them offering free hosting in exchange of good posts, though the terms and regulations as to what constitutes a good posts - differs slightly on these two boards. The posting rules vary too - but all marginally. I believe, Xisto was opened first and then came Xisto. There's yet another hosting solution named Xisto - Web Hosting.Com which offers extremely low-priced paid hosting plans for those who do not want to involve themselves with the forums and don't care about free hosting. All these sites spawned one after the other and all fall into an ever-expanding network of sites under the master brandname Xisto. Hope this helps you get a picture of whats going on For more info & the bigger picture refer to: https://xisto.com/ --------------------------------------------- Am moving this into another forum, since this isn't the right place for this post. m^e
  22. Oh great - have you tried the official eclipse site for any api-s they might have ? They've hundreds of them there... And in case, you manage to find one, please do come back and post the link in here. Would be of great help.
  23. Here's the solution. Since you want DIFFERENT file to be created when the script is executed, we have to depend on some very random non-repeating figure to generate the filenames so that they aren't repeated and there' no chance of name collission and files being overwritten. We can use the microtime() function in php which gives us time resolution finer than a second. microtime() returns a string that contains the microseconds part of the elapsed time since the epoch, a space and seconds since the epoch. For example, a return value of 0.12345678 1234567890 would mean that 1234567890.12345678 seconds have elapsed since the epoch. Here a string is returned, because the double type doesn't have enough capacity to hold the entire value and yet maintain the microsecond precision that is required. list ( $microsecs, $secs ) = explode ( ' ', microtime () ); This will call the microtime() routine and fetch the seconds elapsed since the epoch. The explode function simply splits the returned value into microsecs and seconds based on the space (' ') in between and stores them into the variables $microsecs & $secs with help of the list function (which can assign individual values to the variables provided as its parameter from an array). Once we have the values, we can proceed to defining a unique filename. Lets say, we take the name "Report and append the microseconds part to it - that'd give us a fairly unique filename everytime you run the script. The chances of hitting upon the same filename is about 1/99999999 = 0.00000001 i.e., everytime you access microtime(), you have a chance of 1 in 10 million to arrive upon the same filename - I think you can afford to be pretty happy with the results. Right, lets forge our file name and store it in another variable called $filename. $filename = 'Report' . $microsecs . '.txt'; This just appends your microseconds and ".txt" to the string "Report" giving you a filename like, Report12345678.txt. Next we go about writing that file out... $fh = fopen ( $filename, 'w' ) or die ( "Cannot open $filename for writing. " . $php_errormsg );.....// Code to write data to file.....fclose ( $fh ); That's it - that'll write out whatever you want into this random file and close it - and since we didn't specify any directory for the file to be created in, it happens in the same directory that the script is run from...Now if we put all this code together: .....// Other parts of your script............list ( $microsecs, $secs ) = explode ( ' ', microtime () );$filename = 'Report' . $microsecs . '.txt';$fh = fopen ( $filename, 'w' ) or die ( "Cannot open $filename for writing. " . $php_errormsg );.....// Code to write data to file.....fclose ( $fh ); This should do - I've checked the code and it worked fine on my system. Try it and let me know if it helped.. All the best
  24. This happens to be a very old bug in windows - which never got fixed and MS very conveniently never though of providing a way out (till maybe in somelater versions of XP - I think XP has an option of removing it from the list, in case the installer/uninstaller has gone missing). Anyways, you can either: a. Take the help of a standard System Maintainance software like System Mechanic ( http://www.iolo.com/ ) or TuneUp Utilities ( http://www.avg.com/de-de/tuneup-utilities - beware, german site but still navigable ) OR b. Fall back to good old registry editing. I found this on the MS Site and am pasting it in here for quick reference. You find the link to this article and several others at the bottom of the page. Useful links on this topic1. The Article Above - https://support.microsoft.com/en-us/help/17421/windows-free-up-drive-space 2. https://support.microsoft.com/en-us/kb/247501 3. http://www.techspot.com/community/topics/manually-removing-items-from-the-add-remove-programs-list.1176/ 4. http://forums.xisto.com/no_longer_exists/ 5. http://www.theeldergeek.com/kbi_add_or_remove_programs.htm Hope this helps. All the best
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.