rch1231 169 Posting Shark

Hello,

Normally in this type of situation I say use "grep" to pull individual lines on a specific file. To get all lines and just the first two fields use "awk". But they only work if the data is on the same line as the information you are looking for.

If your file was in the format:

FileName: <actual file name>:Data about file

The awk command would look like:

awk -F: '{ print $2 " " $3 }'

-F: tells it the field separator
print $2 " " $3 tells it to print the second and third fields and the empty quotes put a space between them.

Hope that helps.

rch1231 169 Posting Shark

you have to tell apache what the default web site is for the server put something like this in the httpd.conf file:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
rch1231 169 Posting Shark

try this:

select id, modelname, description, other stuff 
from products 
order by modelname, description
group by modelname

you have to put it in order before you can group it.

rch1231 169 Posting Shark

Hello,

You have got to give us a little more than that. Where in "your web"? What site, what is it for and what page is it on.

rch1231 169 Posting Shark

Hello,

Personally I like defragler. It is free and by the same people who make CCleaner. Gives you many more options and a visual of what is going on.

rch1231 169 Posting Shark

Your computer is set to boot from the network (PXE-Boot) or you have a card installed on the computer that is capable of booting from the network. It is simply telling you that there is no network cable connected.

rch1231 169 Posting Shark

Hello,

You also need to add a user to the mysql users table that connects from the remote IP. (i.e. dbuser@192.169.1.2 ) to tell mysql it is ok to accept connections from that host as that user to the specified database.

rch1231 169 Posting Shark

There are a couple of things that might cause it but my best advise is to go look a the apache logs and see what the error is when they log in. They are notmally kept in: var/log/httpd/<site name>-access_log and /var/log/httpd/<site name>-error_log

One other question is who owns the directory the file is posted to and what are it's permissions?

How does the user login? (ssh, php script, html, etc.)

rch1231 169 Posting Shark

If you don't see the security tab at the top you need to go to the folder settings and un-check the bottom option called "Use simple file security" (or somthing along those lines but it is at the bottom. Once you have done that you can use the security tab to take ownership of the folder and it's subfoldersw.

rch1231 169 Posting Shark

Hit
<CTRL><ALT><F5>
(or <F6>) you should get a shell login prompt. Linux runs multiple login screens. from there you can login as your user.

rch1231 169 Posting Shark

should be

use juggernaught;
rch1231 169 Posting Shark

Hello,

I think I ran into what is happening to you.

Do you have a separate DSL modem that connects for you using a user name and password. I could connect and use the internet if I was connected directly to the DSL modem but when I added the router I could net get anywhere. The router could ping and traceroute to sites but I could not connect. If so what I had to do was to change a setting in the modem to say that it was just a modem and the router was going to login to the PPOE connection. I then put the user and password in the router and set the connection for PPOE instead of DHCP and I was off and running.

rch1231 169 Posting Shark

Hello,

Depends on the OS you are running on the laptops. If it is windows (XP vista, 7) then either run the network setup wizard and create a new local network or turn off the local firewall (your router has one built in) and make sure they are in the same workgroup (wizard will put them in MSHOME). Once you have finished and rebooted you should see the shared folder on each.

rch1231 169 Posting Shark

You need to run your scans from safe mode (or safe mode with networking). Also on another system download UBCD4win (Ultimate Boot CD for Windows) and use it to boot the system and remove the problem files.

rch1231 169 Posting Shark

Hello,

Grab the current of Malware Bytes. It's a free download and run a full scan in safe mode. It will tell ouwhat is wrong and fix probably 99% of it.

rch1231 169 Posting Shark

Check device manager and see if you have a wireless network device listed and if it is working properly. If not re-install the wireless device driver (uninstall first if it is installed but shows a problem.)

rch1231 169 Posting Shark

Hello,

Based on what you are trying to do I would suggest that you run a query first to determine which query you need to run using COUNT. Something like:

declare @test1 Integer
select @test1 = count(id) from firsttable where (what ever condition)
if @test1 > 1 and @test1 is not null
begin
....
Do first query
...
end
else 
...
do second query
....
end if

Hope that helps.

rch1231 169 Posting Shark

Hello,

My suggestion is to give your laptop a fixed IP address in the routers subnet. i.e. if your linksys is at 192.168.1.1 use an address of 192.168.1.50 for your laptop.

IP 192.168.1.50
Subnet Mask 255.255.255.0
Gateway 192.168.1.1

DNS Server 192.168.1.1

And see if yo get internet access. Also try pinging from a command prompt on the laptop. Try the following and post the results..

ping 192.168.1.1
ping 4.2.2.2
ping google.com

rch1231 169 Posting Shark

Hello,

You need to make sure that Apache is running on the server first. If it is configured then putting the IP address in a browser should take you to the default site for the server. If you get the Apache logo page then the service is running and you need to set a default site in httpd.conf. If you get no response then Apache is not running.

rch1231 169 Posting Shark

It depends on the version of Access but it has a built in tool for repairing databases. Check your access help for options.

rch1231 169 Posting Shark

Hello,

Yes it is possible. your code will look something like this:

UPDATE table1, table2 
SET table1.field1 = table2.field99,
table2.date_posted = now()
where table1.id = table2.table1id
rch1231 169 Posting Shark

Hello,

i believe if you look into it you will find that an IDE drive (PATA) is basically the same hard disk as a SATA. PATA (Parallel ATA) communicates 8 bits at a time to the drive and SATA (Serial ATA) communicates 1 bit at a time. SATA is faster than PATA and if memory servers me correctly it is because PATA has to be able to maintain compatibility with the older PATA hard drives and SATA using higher speed communications chips that are available now.

rch1231 169 Posting Shark

All you need to do is go buy a small (4 or 5 port ) router from your loca; computer store. You then plug the router's WAN port into the port on the DLS modem and your computers into the LAN ports and it handles the connections. It will give you an IP address like 192.168.1.X for each machine.

rch1231 169 Posting Shark

By the look of the code you have a missing quote mark to end the action in the line

<form action="http://localhost/handle_form.php method="post">

I can only see three quote marks not four...

rch1231 169 Posting Shark

Hello,

Your problem is that the server you are trying to connect to is not set to accept outside connections from the other server in mysql. Check out the following link at the mysql site more information on howto connect.

http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html

rch1231 169 Posting Shark

I can log into my SSH account using putty. When I try to connect to the database using the session manager I get error message 1045.
On the Settings tab I filled in the credentials for the database and under Network I set SSH tunnel.
On the SSH tunnel tab I used the credential for the SSH. See picture attached.

If your softwaqre has ssh tunnel built in then remove the settings in putty and use the ssh tunnel in the software. Under the host ut the IP address of the server instead of 127.0.0.1. Your software will handle the rest.

rch1231 169 Posting Shark

Hello,

Not familiar with PC connected in network with a domain name.

Had to hold CTRL-ALT-DEL to enter my credential, worked fine.

Brought the PC at my office, tried to connect to internet, but no connection (figured it was caused by the domain/network ID).

Successfully created a new network connection the usual way, for a connection through a gateway/router.

Rebooted, got the CTRL-ALT-DEL invitation, did it as usual, typed in the exact same username/password combo, but XP does not grant me access and ask for the correct user/pass/domain combo. I have created a new connextion without domain, so I do not have the field to enter the domain name. I'm completely stucked.

Tried all usual tricks, « sans échecs », last good config, dos prompt, nothing works, I always end up on the CTRL-ALT-DEL message where I only have space to enter a username and a password that are invalid (I guess because the domain name).

Does somebody knows what to do to regain access to that PC. since I have no field to input the domain name, and cannot access XP to configure anything?

The only thing I see is to move the drive into another PC and work on particular files, but I really do not know how to do that. Or maybe there is a trick.

Find this is a very bad behavior from XP, cause it should not let you create a connection that will lock you out....

Any idea?

Thanks a lot for your help.

rch1231 169 Posting Shark

Nice, but it gives me a syntax error when i add the thing in red:

select Inventory.`Stock Number`, data1.Category, data1.maxpr from (SELECT DISTINCT
Inventory.Category,
Max(Inventory.Price) as maxpr
FROM
Inventory
GROUP BY
Inventory.Category) as data1 left join Inventory on Inventory.Category = data1.Category and Inventory.Price = data1.maxpr
order by data1.Category

If i dont write (select bla bla bla) before the from, it's ok

Hello,

Sorry about that I may not have stated my last response correctly. In the last message the first block of code was for you the second block was the code I used with my tables to test the syntax. You should have used this:

select 
mytable.name as Name, 
crdt.crm as Classroom, 
crdt.maxdate as `Date`
from (select distinct mytable.classroom as crm, 
max(mytable.date) as maxdate 
from mytable 
group by mytable.classroom) as crdt 
left join mytable 
where  mytable.classroom = crdt.crm 
and mytable.date = crdt.maxdate 
order by mytable.classroom
rch1231 169 Posting Shark

<?php

include 'config.php';

include 'opendb.php';

/*$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';

$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";

system($command);
*/

$dbname = 'jai';//your actual database name

$backupFile = '/home/lakshmi/Desktop/hanuman/'.$dbname . date("Y-m-d-H-i-s") . '.gz';

$dbuser = 'root'; // mysql username

$dbpass = 'nandanam'; // mysql password

system("mysqldump -u $dbuser -p$dbpass --quick $dbname | gzip > $backupFile");


include 'closedb.php';

?>

</body>
</html>
everything i jus as u said....but in vain...no db was dumped...i ran the code in netbeans....is der anythin else to be done other than the code n simply runnin it...

Take a look at the error logs.
It may be that the apache user does not have permission to write to the directory /home/lakshmi/Desktop/hanuman/

Can you get logged in via ssh and try the command from the command line? It may require full path to find mysqldump or something else. If you can connect with ssh try the following from the user prompt:

mysqldump -u root -pnandanam jai

It should output to the terminal. If it works then add

> /home/lakshmi/Desktop/hanuman/outfile.sql

and see if it creates the file. If that works stick the whole command line in the quotes and see what happens. I would like to know what it is when you figure it out.

rch1231 169 Posting Shark

Getting trick now...

Ok here goes...

select mytable.name as Name, crdt.crm as Classroom, crdt.maxdate as `Date`from (select distinct mytable.classroom as crm, max(mytable.date) as maxdate from mytable group by mytable.classroom) as crdt left join mytable where  mytable.classroom = crdt.crm and mytable.date = crdt.maxdate order by mytable.classroom

I use a similar query on a table of mine and it worked...

select Inventory.`Stock Number`, data1.Category, data1.maxpr from (SELECT DISTINCT
Inventory.Category,
Max(Inventory.Price) as maxpr
FROM
Inventory
GROUP BY
Inventory.Category) as data1 left join Inventory on Inventory.Category = data1.Category and Inventory.Price = data1.maxpr
order by data1.Category
rch1231 169 Posting Shark

It has been a while since I used the windows version but if I remember correctly it is the same syntax for both. It is odd but there is a space between -u USERNAME and no space between -pPASSWORD

On Linux I put all my sqlcode in one file (mycode.sql) and the redirect it in to mysql like this:

mysql -u root -ppassword < mycode.sql

Hope this helps.

rch1231 169 Posting Shark

Hello,

try this where one.csv is your file and it will create a file with the IP address as the name with the whois data,

for x in `cat one.csv  | sed s/\"//g | awk -F, {' print $2 '} `; do  whois $x > $x; done
rch1231 169 Posting Shark

Sort will work inside the loop but only for the data it is passed via the pipe which in this case is one record at a time. Why not output the file with the number at the front and then do a sort -n and it will sort the first column numerically.

rch1231 169 Posting Shark

You might want to re-read your question:

anyone has ideas? i could cd to %ProgramFiles%... or move folder anotherFolder

No where do you mention the windows shell or what OS. You are correct about the variable provided it has been set in your environment. Try:

echo %ProgramFiles%

from your windows shell and see what you get. If you are trying to move program files to a new location from a system where you do not have Administrative Privileges forget it. You would also not be able to move it if any application is actively running from the directory.

Next time phrase your question correctly and tell us what your goal is and why and I will be your get some better answers.

Salem commented: Yeah, the slow drip of usable information is hard work +20
rch1231 169 Posting Shark

thank, now i understand how to use the MAX() properly, but i still have a problem. The SQL statement you gave me will only selects the latest date for one of the "tables". What if i wanted to pick up the latest date for each of the "tables"

Ex:
Classroom2

Name: | Date:
Oliver | 10-10-10
Homer | 08-10-10

Classroom1

Name: | Date:
James | 20-10-10
Lars | 01-10-10

I want both of the greens to be displayed. MAX() will only get the 20-10-10 right? and i will not be able to select the other then...

Picky Picky Picky..

Try this:

(Select * 
from mytable 
where mytable.classroom = 'Classroom1' 
and mytable.date = (select max(date) 
from mytable where classroom = 'Classroom1')
) UNION (
Select * 
from mytable 
where mytable.classroom = 'Classroom2' 
and mytable.date = (select max(date) 
from mytable where classroom = 'Classroom2')
)
rch1231 169 Posting Shark

rch1231 thanks so much i think your help is great!!!

One thing if you dont mind how would i do my queries?

At moment i have been using dreamweaver with php/mysql and creating my recordsets in dreamweaver from the mysql database and displaying and using dreamweaver to do the inserts and display the data in a table.

I have been able to simple queries and have been managed to do a few join queries with help from other people along the way.

However i am not sure how i would do these queries to display by month, year and how much due??

Could you help please point me in the right direction or advise where i should do the queries, database or app??

Thank you again

You need a real query editor to create them with. You can get one for free from http://dev.mysql.com that will allow you to connect to the database and help you create the queries. I have a well worn copy of O'Reilly's MYSQL cookbook that has been great.

rch1231 169 Posting Shark

nothing offensive, but it is way off man.

Gee it works fine for me...

C:\Users\Rodney>mkdir "c:\Program Files"\test

C:\Users\Rodney>edit test.bat

C:\Users\Rodney>test

C:\Users\Rodney>cd "c:\Program Files"

c:\Program Files>move test newtest
        1 dir(s) moved.

c:\Program Files>cd \Users\Rodney

c:\Users\Rodney>type test.bat
cd "c:\Program Files"
move test newtest
rch1231 169 Posting Shark

<?php


// Change Me

$username = "root";
$password = "pass";
$connect=mysql_connect("localhost","root","nandanam") or die("loser");
$db= "jai";
@mysql_select_db($db) or die( "Unable to select database");
$temp="/home/lakshmi/Desktop/hanuman/backup5.sql ";


$cmd = "$dump -u $username -p$password $data --quick --add-drop-table $db $t > $temp; gzip $temp ";

system($cmd);
?>

</body>
</html>

then clicked run , no error was shown but the database was not dumped...didnt serve my purpose....is der anything wrong in wht im doin????

Well you never define $dump = mysqldump and what are $data and $t for?
And checking I found the following syntax through google which shows your original | to gzip:

<?php
include 'config.php';
include 'opendb.php';

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);
include 'closedb.php';
?>
rch1231 169 Posting Shark
cd "c:\Program Files"
move folder newfolder
rch1231 169 Posting Shark

Classroom2

Name: | Date:
Oliver | 2012-10-10
Homer | 2012-10-10
Peter | 2011-11-10

Classroom1

Name: | Date:
James | 2012-10-10
Lars | 2012-10-10
John | 2011-10-10

This my table:
Classroom : Varchar
Date : datetime
Name : varchar

I'm looking for the select statement, not how to format the date...
the text in red i not to be selected

You need a sub query to find the max first then get the data based on the result. If should be something like this:

Select * 
from mytable 
where mytable.classroom = 'Classroom1' 
and mytable.date = (select max(date) 
from mytable where classroom = 'Classroom1')

Watch out for the datetime vs. date variable type if you are looking for all things on the same day.

rch1231 169 Posting Shark

I would drop the Commission field from the Policy table(s) and add a new table called Policy_Reps_Comm:

PRC_ID
Policy_ID
UserID
Date_Started
Date_Ended
Commission_Percent_Of_Total

On the last field it could also be commission_amount instead of a percent of the total.

Splitting the data out into a separate table you can handle things like:
Record 1 rep AAA gets 2.5% on policy 1234's Total_Premium
Record 2 rep BBB gets 2.5% on policy 1234's Total_Premium
Record 3 rep CCC gets 5% on policy 1234's Total_Premium because Rep AAA and BBB work for him.

By having a start and end date and creating a new record if the commission amount changes you have enough data to be able to recreate commissions. It gives a history of Rep AAA was paid r% from this date to this date and s% from this date to this date and t% since then. By having one rep per record you don't have to check for the other fields being filled in when doing your calculations and can make one pass through the table. It will make a lot of things easier in the long run, trust me.

You will be able to create queries that link all of the data together at the time you need it and hopefully very few holes to try and fill in later.

rch1231 169 Posting Shark

By the look of the data your date field does not have the variable type set as a "date". MySQL normally displays date in the format:

DATE 'YYYY-MM-DD'

see the following for more info:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.html

rch1231 169 Posting Shark

Who did the email come from?

Check with a site like http://www.dnsstuff.com/ and use the who is ption to make sure you are still the contact on the domain name and contact your registrar and tell them you did not make the request.

rch1231 169 Posting Shark

Hello,

The answer to that generates a couple of new questions.
What is the maximum number of Reps that share a commission?
How is commission determined (flat rate, percentage of total, etc.)?

Normally in SQL when you have multiple values you spin off a new table and link it back with a record ID. If it is NEVER going to be more than 2 Reps you could create 2 sets of fields in the Policy table to hold the data but it is not the best method. You now have to code to check both fields and output for each. It is better to make a new table. You could decrease the number of tables by combining the Policy tables into one and adding a policy type flag.

rch1231 169 Posting Shark

Opps forgot to add that part.

$cmd = "$dump -u $username -p$password $data --quick --add-drop-table $db $t  > $temp; gzip $temp ";

      system($cmd);
rch1231 169 Posting Shark

Hello,

Assuming you have the variables set correctly and system is not disabled you need a space between the -u and $username but none after-p for $password. The grep for the message is not needed since it goes to the terminal screen and is not output to the file. And I suggest creating the file then gzip'ing it. Try something like this for your code:

$cmd = "$dump -u $username -p$password $data --quick --add-drop-table $db $t ; gzip $temp ";
                    system($cmd);
rch1231 169 Posting Shark

Uhm "==", maybe?

Hello,

A couple of things:

Try using the following to call your script (called myscript.sh) so you can watch it run:

/bin/bash -x ./myscript.sh

Your error is probably coming from the ";" at the end of the for line which terminates the for loop with the do statement.

The next issue I see is you used:

for line in $(ls -ll | grep ^d|awk '{print $9}');

instead of

for line in `/bin/ls `

If your login is set like most to return the output from "ls" in color it really throws the script off so make sure you use /bin/ls. Also you need to move one of your change directory commands and remember to return back to the parent dir when finished:

for line in `/bin/ls`
do 
cd $line 
for lines in `/bin/ls`
do
cd ./$lines
if [ $lines == "final_outputs" ]
then
 #textme=`find . -name test_concatenated_RAxML_outputs.txt -printnes/ ../../../texttemp/`
textme=`ls -l|grep -v '^d'|awk '{print $9}'`
if [ $textme = "test_concatenated_RAxML_outputs.txt" ]; then
cat $textme >>../../../texttemp/final_outputs/test_concatenated_RAxML_outputs.txt
elif [ $textme = $str2 ]; then
cat $textme >>../../../texttemp/final_outputs/r_test_concatenated_RAxML_outputs.txt
elif [ $textme = $str3 ];then
cat $textme >>../../../texttemp/final_outputs/m_test_concatenated_RAxML_outputs.txt
elif [ $textme = $str4 ]; then
cat $textme >>../../../texttemp/final_outputs/n_test_concatenated_RAxML_outputs.txt
elif [ $textme = $str5 ]; then
cat $textme >>../../../texttemp/final_outputs/h_test_concatenated_RAxML_outputs.txt
else 
cp -r ./ ../../../texttemp/final_outputs
fi
cd ..
fi
rch1231 169 Posting Shark

Thanks for the doc file. I think my ISP is blocking me. It has a firewall that is not allowing external apps from talking to MySQL servers.

Hello,

If you can ssh to the server then the tunnel will work because the firewall will only see port 22 being used. It may be your MySQL login. Try using 127.0.0.1:3306 on the tunnel page in destination instead of localhost:3306 or post he error message.

rch1231 169 Posting Shark

Hi,

I was looking for some help with how i would go about setting up my commission table.

Basically i have currently:

Users Table
UserID
Username
Password
Email

Clients Table:
ClientId
Client_UserID
FirstName
LastName
Address
PostCode
Tel
Email

Insurance Table:
InsuranceID
Clients_ClientID
Provider
Commission
DatePaid

CarInsurance Table:
CarInsuranceID
Clients_ClientID
Provider
Commission
DatePaid

I want to setup a commission table to track commission due for a user and list the provider and client name.

I am not sure if i should have a UserID column in my insurance tables for this to work?

Could anyone advise on what my structure should be?

I need to query it by dates.

So in the website the user needs to be able to filter the results based on month and year.

So show how much they have made in 2010 or show how much they have made in just the month of April.

Also if possible show how much is due to come in.

So if the datepaid column is null then show the total commission due in, then once it is paid it will change to show paid.

Hope someone can help me with this, appreciate your help.

Many thanks

Hello,

This may not be all you need and is based on what I would do. Remember there is more than one way to solve the issue so review this …

rch1231 169 Posting Shark

Hello,

Try bringing up task manager and minimizing it to the task bar then let the screen saver kick and see what is taking up all of your CPU time. If nothing else download Maleware Bytes, update it and let it scan your system (may take an hour or two). There is a free version just make sure you are getting it from their site.