School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

 

Code Snippets

  

Linux & UNIX Source Code


Welcome to Dream.In.Code
Become an Expert!

Join 308,841 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,100 people online right now. Registration is fast and FREE... Join Now!





Linux & UNIX

Bash(13)Python(122)



Submitted: July 28, 2007        Views: 1037
Google treats non-www and www as separate sites. They recommend using redirect to send all traffic to the URL you want to use. This will also redirect all domain variations to the domain of your choice (i.e. .us to .com, .cc to .com, .org to .com)
Submitted: January 4, 2008        Views: 2089
I wrote this for someone who wanted to learn Bash, so there are more comments than I usually put in my scripts. This script keeps multiple archives of a single directory. Ex. Say you want to backup ~/stuff. ~/stuff changes a lot, and is important, so you want to back it up (and you want to keep revisions of it to prevent a mistake overwriting the good backups. Now unfortunately, you don't have an infinite hard drive, so you're only going to keep 5 revisions of ~/stuff. This script lets you do that. When 5 revisions exist, and you want to make another backup, the oldest revision is deleted to make space.
Submitted: August 15, 2009        Views: 308
This snippet shows how to make a very basic text editor with Tkinter
Submitted: April 6, 2005        Views: 2017
Prints out the % of laptop battery remaining.
Submitted: January 20, 2009        Views: 1553
You can fit the best straight line by least square method from given data.
Submitted: October 2, 2008        Views: 1089
This snippet will echo the total linecount for a directory.
Submitted: November 21, 2006        Views: 1366
An example of using the random library, as well as a while loop
Stack Class in Python by parelem
Submitted: April 1, 2009        Views: 557
Class for implementing stacks in Python
Submitted: March 25, 2009        Views: 921
Creates a basic, transparent text editor, that stays on top of other windows.
Submitted: January 17, 2009        Views: 1513
You can easily find out your age.
Submitted: January 4, 2008        Views: 1724
This script counts the number of files in a directory. If the number of files exceeds a certain value, delete the oldest until the value is met. Ex. 10 files are in a directory, 5 new files are added. If the limit value is set to be 10, the 5 oldest files will be deleted.
Bubble Sort (Python) in Python by KYA
Submitted: July 20, 2008        Views: 3075
Bubble sorts a list
Submitted: March 19, 2009        Views: 365
First calculates factorial and then find out permutation.
Submitted: July 1, 2009        Views: 366
A fully functioning binary search tree
Submitted: December 15, 2008        Views: 1148
Here the recursion of a function is used to find the factorial of a given number.
Submitted: July 18, 2007        Views: 2668
Alter the MAC address for your Network Interface Card.
Submitted: January 26, 2009        Views: 881
This is a simple function using while loop which print the numbers of fibonacci sequence.
Submitted: July 19, 2007        Views: 4141
How to change(Mask) your ip address in Linux
Submitted: October 23, 2006        Views: 1921
This is actually a very simple game I thought of constructing after answering a Python question in the forums. It demonstrates the use of a while loop. It also demonstrates a simple use of the random library
Submitted: July 31, 2008        Views: 1870
Like many tasks in Python, it's very succinct - so short it barely deserves to be a snippet. Advantages: Opens window on top (in focus); no cmd.exe window is opened **New to Python 2.4 SOURCE: http://bytes.com/forum/thread40765.html
Perfect Number in Python by shadhin
Submitted: March 8, 2009        Views: 831
Checks if a number is perfect or not. A number is said to be perfect if it equals to the sum of its factors.
Prime Number in Python by carltech
Submitted: September 12, 2008        Views: 1812
A simple 8 line program with nested for loops used to find prime numbers
Quick Sort in Python by KYA
Submitted: July 20, 2008        Views: 1367
Utilizing recursion, we can quick sort a list
Submitted: January 27, 2009        Views: 1256
This function can search for a specific character in a string.
Alarm Clock in Linux & UNIX by no2pencil
Submitted: January 15, 2008        Views: 2347
Use /dev/audio as a functioning alarm clock


Submit a Code Snippet and get a chance to win a </dream.in.code> 1GB Thumb Drive!







Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month