Programming :: Searching For Tutorials Bout Could Never Figure Out MVC
Aug 3, 2010I tried searching for tutorials bout could never figure out MVC.
View 13 RepliesI tried searching for tutorials bout could never figure out MVC.
View 13 RepliesI am familiar with C, C++, and Python at a novice level. I have recently tried learning bash, but I can't seem to wrap my head around it. My biggest problem, I think, is the huge "vocabulary"-- it seems like there are thousands of commonly used commands, and several ways to use said commands.I've done some google searches but can't seem to find scripting tutorials that tailor to n00bs. Most go from basic "Hello World" programs to very complex scripts.
View 5 Replies View RelatedI did searched you tube but my results were not great.I have 2 books on KernelProgramming.I feel I need if some where I can get a video tutorial which can help me to understand how to develop a Linux Device driver that will be great.I had a look at Greg Kroah Hartmans video lecture of developing patches on ......I have been reading books and a lot of stuff.So I wish if I could get a video lecture that would be better
View 1 Replies View RelatedSo I've been writing a code and I have been adding functions to make life easy, but all of a sudden when i added the last function I got this error *** glibc detected *** /home/ahzeeper/Desktop/C-code/check6: free(): invalid next size (fast): 0x0804c048 ***followed by a huge backtraceNow here is my code
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
[code]...
I've read so many posts discussing 'bout how to install prolink modem. I've followed all the posts instructions, but still none of them could me to detect this modem. I've done all the steps explained in this link
Code:
[URL].. in which many people succeded by following those steps. i already installed the latest usb_modeswitch, wvdial, gnome-ppp and all the things explained on that link.
First of all, i do all the steps explained on that nmxlaxaman link n then i restart my laptop. After then, without modem being plugged, i check with lsusb command n return
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 002: ID 046d:c052 Logitech, Inc.
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 004: ID 0000:0000
[Code]...
im working on a mini project which basically use a simple database(Database.txt) which displays its information in this format :apple chiku banana
Code:
#!/bin/bash
Title=
[code]....
I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files
What I am doing in my script is
for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then
[Code].....
I have a file that contains 5 fields and anothen one with two I want to take the value from user and search file1 and if the value exists then write in file2 to the $2 to the line that $1=value
file 1
1:fsdfsd:g:33:fsdf
2:yytgdcf:a:3:sgd
[code]....
I'm making a small script for searching and doing some operations with photos, but I'm kinda stuck on this little function:
Code:
function findallformat {
prefix=""
if [ $1 = -pre ] then
[code]....
That function should find for every file with a certain type; and you can specify a prefix using a "-pre" followed by the prefix that you want to search. The format should be "stackable", so you can use as many types that you want, without repeating the same function on the code.
Example: findallformat -pre IMG_ .JPG .CR2 #That should search files that start with "IMG_" and finishes with .JPG and .CR2. My problem it's that, when I try to use it on the script, it says "bash: syntax error near `token' unexpected `}'"
I am trying a search for a pattern in the file. I can have any character in the pattern. I am pretty sure I will have $, ", ', ^, ` etc., The Problem I am facing is if I use "" (double quotes) to enclose the pattern, it gives special meaning to $, ^ and " within the string. I have no control over the pattern input. I am getting it from some other file. On the other hand, If I use '' (single quotes) to enclose the pattern, it gives special meaning to the ' (apostrophe) within the string and terminates the pattern prematurely. How do I disable the special meaning these characters have? For example, in perl, I could enclose the pattern within Q and E. Is there an equivalent in grep pattern expression? I could find one in the man page of grep. Is there a solution to this problem?
View 5 Replies View RelatedI have searched diligently but can't seem to find a way to search by exif date. Most of my searches turned up commands to manipulate EXIF data not just search by it. I have found some likely tools but suspect that I don't know enough bash to recursively find a .jpg file by it's exif date. For example, exiprobe and exifgrep look promising (see examples below).
I have made some progress. At first, I couldn't associate the file name with the date given but learned that the "n" option forces each output line to start with the file name. Now, I need to make the command recurse but can't seem to manage it.
halloween_IMG_0965.JPG: JPEG.APP1.Ifd0.Exif.DateTimeOriginal = '2009:10:31 20:58:52
If it helps, I have linked to the man pages [URL]
...and returning the index of the found element in its array.
I have:
for ((i=0; i < ${#array1[@]}; i++)); do
# Read each line of the file test
if [[ $(eval "sed -n '$(($i+1))'p test") == *${array2[0]}* ]]
stuff
I want to find the index of the found substring in array2 and only if it isn't found, move on to the next element of array2. I don't know the size of array2 so that [0] has just got to go.
My script looks really crap and messy, the logic isn't great and I'm not hugely happy with it. Also it echo's $i instead of an actual IP address (line 10). How to improve this. It basically searches through /var/log/messages for multiple FTP hits and when the hit count is higher than a specific number the IP is added to a config file and ftp is restarted. There are some obvious flaws in my script.
Code:
MAXHITS=0
TOPHITS=`grep "FTP session closed." /var/log/messages* | awk '{print $7}' | sed -e 's/^.*[//' -e 's/].*$//' | uniq -c | sort -nr`
HITNUMB=`echo $TOPHITS | awk '{print $1}'`
IPHIT=`echo $TOPHITS | awk '{print$2}'`
HIGHIP=`echo $TOPHITS | grep $HITNUMB | grep $IPHIT | awk '{print $2}'`
if [ $HITNUMB -gt $MAXHITS ]; then
for i in $HIGHIP;
do
echo $i
sed -i '78s/$/,$i/' /opt/etc/proftpd.conf
/root/ftp restart
done
else
echo "not greater than $MAXHITS"
fi
I'm not even sure what will happen if I get multiple responses for my $TOPHITS. It would be cool if it could search for IP's already blacklisted somehow, it might actually be easier to just create a file with a set of blacklisted IP's or something.
Suppose i have a file(1.txt) separated by TAB delimiter in a line
1 B AB 2
2 C AB 2
if I need to search for the records having B?? using grep.If i need to perform multiple search like line having "C and AB" or "B and AB"??
I have a load of emails in my Thunderbird trash folder and some of them (all with a similar subject) I want to extract the email address for them and put in a text file. I have located the trash file but it seems that it is just a big flat file with a concatenation of all my emails in it, varying number of header lines etc etc - ie, something which really doesn't seem to suit awk, sed, grep etc.Does anyone know of any way this might be accomplished, or any third party tools which may help?
View 1 Replies View RelatedI am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files What I am doing in my script is
for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then
[code]....
I have around 100+ files name with some particular extension , this code works fine if the directory name does not have any special character in it like " "(white character) .
It is failing to give the output. IF I run the find command on the console the I am getting the correct file name with location
/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
/home/user2/public_html/index test/pop.mp3
/home/user2/public_html/index test/web.xml
/home/user2/public_html/song.mp3
If I echo the file name from the script Then output is little missed match when a directory name has special char like " "
/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
[code]....
I am not sure what is wrong with script or my code .. Does shell have un-controlled behavior of manipulating the output of any command.
I'm trying to search for several strings, which I have in a .txt file line by line, on another file.
So the idea is, take input.txt and search for each line in that file in another file, let's call it rules.txt.
So far, I've been able to do this, to search for individual strings:
Code: Select allimport re
shakes = open("output.csv", "r")
for line in shakes:
if re.match("STRING", line):
print line,
How can I change this to input the strings to be searched from another file?
So far I haven't been able to.
Code:
#!/bin/bash
VARR=`cat /proc/asound/cards | grep HDMI | cut -c 1-2`
VARX="defaults.ctl.card $VARR"
VARY="defaults.pcm.card $VARR"
FILE1="alsa"
FILE2="alsa.new"
echo $VARX
echo $VARY
sed "s/defaults.ctl.card*/'$VARX'/g" $FILE1 > $FILE2
This is what I have right now. Well, I thought I knew sed, and apparently I don't... I tried writing this for someone else, and this has given me trouble, so since the user pretty much figured it out on his own, here it goes.
Say VARR=1, so VARX and VARY contain the above text, appended by 1.
What I am trying to do is replace the text "defaults.ctl.card 0" by VARX and "defaults.pcm.card 0" by VARY. The contents of FILE1 is the file being used to search for both text fields, and FILE2 is the output file. I tried using single quotes, double quotes, and a mixture of both, and no go whatsoever. So my question... What is the proper way of searching for text within a file and replacing with a variable?
(bare with me as I am sort of new with scripting) I am trying to figure out how to run a script that does a basic chkconfig and to get only those services that are running, but changing the color of "on" to red in my output file. Here is what I am working with so far:
Quote:
#/bin/bash
RED=$(tput setaf 1)
BLK=$(tput setaf 0)
[code]....
*I had to substitute a "-" and <colon_symbol> for ":" in front of the on's, because the forum thought they were smiley faces (i.e. n) how to make the "on" to be red while the rest of everything remains in black text. I have been trying to read up on sed and awk, but it is still pretty much a mystery to me right now. There will be other things in the output file that I wouldn't want a rogue "on" to be in red, so just the instances of "on" in that one chkconfig return.
I plan to design a general framework for structural optimization.I already have a pre-processor module that I can call in batch mode, a Finite Elements Solver, and a heuristic non gradient based optimizer that can process the outputs of the solver, so as to adjust some input variables in the pre-processing phase ( geometry and topological definitions of my structure ).
I would like to parse the huge ammout of data that is released by the solver ( an ascii text file) to filter out some reauired results in some specific points ( maximum allowable deflections or stresses within my structure ) since it is this infoemation that will be fed to the optimizer engine so as to feedback on the quality of the changes made in the topological definition.The only way to do this in batch mode is with awk, or with sed..
I am interested in working with zfs fs's and I am looking for tutorials on the subject, I am working with the Centos distro, can you send some links my way.
View 2 Replies View RelatedI know there is a lot of information about it, but I'd like to get help of any developer who uses it.I'd like to learn to program in C++ (time ago, I programmed in C and Java).Questions:- A good tutorial? and Samples? - I've installed Eclipse Helios. Is a good tool for developing C++? - I use KDE. A tutorial for developing a KDE application? - Where to get more help: forum, chat.
View 4 Replies View RelatedI can not get the touchscreen to with ubuntu 1010 netbook are there any tutorials? i googled around but didn't find what i was looking for
View 1 Replies View RelatedCollection of Tutorials on lisp. [URL]
View 1 Replies View RelatedI have a ps3, and I want to put Fedora Core 11 on it. But i don't know how. (i've already downloaded the Fedora Core 11 PPC)I can't find tutorials for the install of this version. (Sorry, I don't speak english very well) In my PS3 , I used Yellow Dog Linux (it is too slow, and bugged), Ubuntu 8.04 (lol, it dont support HD resolutions).I use my PS3 in the same monitor of my PC. (). 22" LG Monitor.
View 3 Replies View RelatedI am a moderately skilled windows user with some dos knowledge that has just transitioned my PCs over to Ubuntu. this is the first time I have had ANY exposure to Unix/Linux. I am looking for some literature or video tutorials that will help me transition to Ubuntu. The basic functions are so similar to windows and mac OS X that I am moving easily around the desktop, but I want to go deeper. I want a little history of how we got from Unix to Ubuntu but quite honestly I don't know what I can do with what I have.
View 9 Replies View RelatedI was wondering is there any good tutorials on how to create a good webserver... i have found a few but i was just trying to verify the info on the ones that i found.
View 2 Replies View RelatedI'm compiling gtk+-2.22, and while building, I get this error:
[Code]....
Is there a way around this, or can the building of docs be suppressed?
I'm currently looking at a Mac Terminal tutorial:[URL]... I want to learn about Linux Terminal, is there a difference between the Mac Terminal and Linux Terminal commands and Internet tutorials?
View 1 Replies View RelatedSites providing video tutorials on linux which are free to download. I've got one site "www.showmedo.com". Here I can get different tutorials on opensource like scribus, gimp, C++,python etc.
Can anyone provide me any other good sites like this?