***: ballen is now known as ballen|away
baklava has quit IRC (Read error: 105 (No buffer space available))
baklava has joined #arpnetworks up_the_irons: ballen|away: yeah, i get the idea (what a pun!) ;)
sroute: yup, that would explain it
BeBoo_: your screenshot looks cool teknicaL: what screen shots? up_the_irons: teknicaL: http://www.beboobailey.info/getegg.png teknicaL: oh
guess I'll be needed an upgrade soon. haha
Would help if I can type. Should get some sleep up_the_irons: hehe teknicaL: 6am and still haven't slept. Bad habit of a sleep schedule. lol ***: BeBoo_ has quit IRC (Read error: 60 (Operation timed out))
Element` has joined #arpnetworks
BeBoo_ has joined #arpnetworks
teknicaL has quit IRC (Read error: 110 (Connection timed out)) obsidieth: heh, speaking of suck
such.
i just realised ive been installing a spoitable eggdrop through my commands for quite a while ***: heavysixer has joined #arpnetworks
heavysixer has quit IRC () mhoran: jeev, up_the_irons: re: kern.hz -- part of the problem is with context switchinh, which Parallels and VMware (desktop) are notoriously bad at. KVM has some optimizations which make this not so bad. ***: bithash has joined #arpnetworks
bithash has quit IRC ("leaving")
heavysixer has joined #arpnetworks
heavysixer has quit IRC ()
heavysixer has joined #arpnetworks baklava: I'm going through withdrawl
I had fun setting up the new VM, and now that it's done it just sits there working and I just have to stare at it :) BeBoo_: up_the_irons: thanks @ the screenshot
baklava: i know how that fels
feels*
makes you wantto buy another one just to set it up again, right?
or rm-Rf *
:x baklava: not that bad :) BeBoo_: heh
i just hope if i get another one, i'll know what i did to this one
lol baklava: :P
I made sure to document when I set this one up
I don't setup systems regularly so I usually have to go back and look a bunch of stuff up that I've forgotten BeBoo_: thats what i end up doing... scp'ing configs and reinstalling stuff i think i need
but we set this one up with mls which was confusing as hell so i'm probably gona try to document what we did baklava: hehe BeBoo_: i can use the .bash_history file to give me a good idea of what i did on this one jeev: anyone php it up here? baklava: yea jeev: mind helping my sexy ass baklava: what's up? jeev: im sending $1 through $4 through a php with POST to another php
the other php which im posting to is taking $1 through $4
it works OK but the problem is that i want to accept more than one check
get what im saying baklava: somewhat, can I see it? BeBoo_: array, jeev ?
you can serialize an array and send it to the second php script jeev: http://www.pastebin.ca/1590821 BeBoo_: so the second script just decrypts the array jeev: i read the array's for checkbox
making them the same name and adding a [] but i couldn't read it
alll i could do is dump it
i still dont understand how i could make it add the selected product names and descriptions and price together BeBoo_: you want to add the total or what was selected? jeev: add the total + name and description baklava: this looks like a job for OOPHP BeBoo_: i would do a multi-dem array
using [] jeev: yea tried that last night baklava: you should have an array of check
s
check objects BeBoo_: $products['name'][]
$products['desc'][]
$products['price'][]
something like that baklava: that have all this stuff, so you don't have to fool around with it jeev: the name and description are actually set inside the php that's posted TO BeBoo_: ah ok jeev: the set up is if $1 is enabled, set this..
http://www.pastebin.ca/1590821 BeBoo_: would still be the same jeev: im a pretty big noob, just starting to learn the basics of coding. BeBoo_: i can help you with it, it's not too hard
i did something similar when i created my dns panel jeev: ok
do you want me to set up the array again BeBoo_: did $dns['A'][]
etc jeev: ok, i did:
<input type="checkbox"
name="option[]" value="0" />
through option 4
is that right
then it gets posted to the php that i showed you BeBoo_: to be posted to the script you pastebined? no jeev: how come
no
i put that in the previous file
which posts to what i pastebined BeBoo_: you just need to call that something. you handle that in the resulting script jeev: this is right
i set it in the right script BeBoo_: can you maybe send me the entire two scripts so i can understand what you are trying to do?
i'm still a little lost at what this does jeev: well give me a second first
let me explain this BeBoo_: k jeev: right now
it's spitting out the array
whatever i check.
cause i tried it last night
the php i pastebinned is what is spitting it out, the entire thing
it's some nasty code, i really can't sift through it BeBoo_: lol jeev: Array ( [0] => 1 [1] => 2 )
if i check box 2 and 3
that's what shows up, whcih is right
i named them 0,1,2,3,4 BeBoo_: k jeev: what do i now? how can i accept this
$_POST['option'][]
? BeBoo_: is that the array? jeev: yes BeBoo_: see the name is wrong... on the input type
i feel
you can't have a postvar with that name jeev: <input type="checkbox"
name="option[]" value="3" /> BeBoo_: it would be $_POST[
err jeev: that's what im telling you, is i was stuck here BeBoo_: $_POST['option[]'][0]
oops.. replace the } with ] jeev: oh, why then is the [] necessary BeBoo_: it isn't
-_-
thats why i said the name is wrong jeev: i read that that's how you start an array BeBoo_: in PHP, yes
but not in html
that is just a name of that field
that has nothing to do with starting an array jeev: so the []'s are useless? BeBoo_: yes jeev: sec BeBoo_: in those <input> tags jeev: so just name
option.
that's it ? BeBoo_: yes jeev: and a value
done BeBoo_: then, in the resulting script, use $_POST['option'][0]
or
$_POST['option'][1] jeev: ok BeBoo_: might need to put those in single quotes tho
$_POST['option']['1]
gah jeev: but where should i put it BeBoo_: i am still waking up, sorry jeev: what should i surround it with
should i like $0 = $_POST['option']['0']
? BeBoo_: where ever you are testing the first checkbox which i'm guessing is $porduct1 ? jeev: ok BeBoo_: $product_1 = $_POST['option']['1']
oooo wait a sec Thorgrimr: You just trying to allow them to submit one from a list? jeev: yea BeBoo_: i am totally confused jeev: :< Thorgrimr: If they can only choose one, use radio buttons BeBoo_: if you only want one, you need to use a radio button
not a checkbox jeev: no
not submit one from a list BeBoo_: and you would do a case statement on $_POST['option'] jeev: sorry i read that wrong
i have 5 checkboxes
any 5 combination could be selected
actually, i have one select all which sends all.
the other combination of 4 could be selected
i want it to add it together. BeBoo_: ok jeev: it's a service with options. BeBoo_: forget what i said earlier. -_- those checkboxes need different names
like prod1, prod2, prod3 jeev: sono array ? Thorgrimr: Then use your <input type="checkbox" name="product[]" value="1" /> etc BeBoo_: eh jeev: hmm
that's what i read last night Thorgrimr: THen you have an array named product, that you can iterate over jeev: yea BeBoo_: but it would be within $_POST[] jeev: i get that it sends over the array
yea BeBoo_ Thorgrimr: Yes jeev: but i dont know what to do after that
i mean i can get it with _POST Thorgrimr: if ($_POST['product'][1]) { box 1 was checked) etc jeev: but do i have to have that for each product and possible product
to match it up?
if product 1 and 3 are selected.. ***: ballen|away is now known as ballen Thorgrimr: Just run it through a while or foreach loop jeev: hmm Thorgrimr: foreach ($_POST['product'] as $index) { $price = $items[$index]['price'] } or some such -: jeev is lost BeBoo_: lol Thorgrimr: Sorry ;) BeBoo_: sec, jeev, working on it jeev: i sort of understand the foreach
but i'm just lost BeBoo_: lost where? jeev: how do you set the prices of ecah product
then the descriptions and add them together Thorgrimr: Set up an array of hashes and store that info in it
Then you can just reference those values by the boxes the user checked
Iterate over their choices picking out the checked products and sum em up jeev: hm
why do i even need an array, the previous way iw as doing it
it was just sending which ever name was enabled, the value
i mean it was just fine Thorgrimr: You don't jeev: i just needed a way to add up the fields Thorgrimr: But if the number of products increases, your code to process it will have to keep increasing jeev: yea it really wont
it's not a shopping cart for items, just a service with options
a couple options Thorgrimr: By iterating over an array, the code never changes regardless of whether you offer 5 or 1000 options BeBoo_: jeev: then then do $sum = 0; then in the if statements just to $sum .= $price; jeev: i understand BeBoo_: err not .=
lol Thorgrimr: += BeBoo_: yeah that
sorry jeev: bah BeBoo_: i need some tea or coffee or something jeev: i need a miracle
http://www.pastebin.ca/1590821
can i set
product_1's product_name to product_name1
and ... for the rest
then try to add them up
$product_name1 + $product_name2 + .. BeBoo_: http://www.pastebin.ca/1590873 jeev: oh BeBoo_: depends on how you want to output it jeev: and the same with text, right BeBoo_: that code will just add the prices jeev: except, how would i put ,'s
to separate BeBoo_: $products .= ", ".$product_name
in each if
cept the first one
drop the comma
lol Thorgrimr: But then how does he know which is the first value they actually checked
I would do something like
$product_desc[] = 'THe Description'; in each if jeev: nice, it adds it Thorgrimr: And then just do a $prod_descriptions = implode(',', $product_desc); jeev: i wish i could code man BeBoo_: http://pastebin.ca/1590877
right
true
scratch taht post
thats a good trick, Thorgrimr jeev: rfmfhrmrhrmfm BeBoo_: i have no motivation to do anything today
=[10:34] <jeev> who does ***: ballen is now known as ballen|away
ballen|away is now known as ballen
ballen is now known as ballen|away
Element` is now known as Element
Element is now known as teknicaL
ballen|away is now known as ballen ballen: blah ***: visinin has joined #arpnetworks
heavysixer has quit IRC () BeBoo_: blahj
-j teknicaL: no ***: bithash has joined #arpnetworks jeev: well
Thorgrimr helped me
im almost done, just have to work out some minor things with his code and i'll be done ;)
BeBoo_, ther e? BeBoo_: yup jeev: Thorgrimr helped me out but he's not here
i have a question
$price += $values['price'];
that's set up under _POST['all']
i want to reduce it by 10% if all is checked
which lets just say is 55 right now
how can i subtract it at the end BeBoo_: $price = ($price * .9); jeev: $price += $values['price'] - 55;
subtracts that
55 from every thing BeBoo_: need to seperate it out jeev: heh BeBoo_: you are telling it to add $values['price']-55 to $price
so just $price += $values['price']; $price -= 55; jeev: ahh BeBoo_: or use the * .9 which will give you 90%
gotta think backwards sometimes
it's weird jeev: wait, borked ***: bithash has quit IRC (pratchett.freenode.net irc.freenode.net) jeev: coming up with a weird price ***: bithash has joined #arpnetworks jeev: yea .9 works too
the $price -= 55; doesn't work
does 55 from everything
$pricetotal += $values['price'];
$price = $pricetotal - 55;
worked
well
the thing he did for me was good, i kind of learned from it
i just need to now have the output of the page read the code
cause it doesn't output the way i need it to
if ($count > 0 || $count == 'all')
what does that mean /
if there is more than 0 selected? BeBoo_: $count > 0
means more than 0 are selected
|| mean or
soo
_if_ there are more than 0 items selected or $count == 'all' jeev: ok
figured
he has it printing under that to the screen, what's selected and how much
but i need it to go to the bottom part of the page
maybe i'll try to figure it out myself BeBoo_: bottom part?
oh he's probably using var_dump
?
theres another one... i can't remember the name jeev: na
yea, got it
yay BeBoo_: nice jeev: HELL YES!
just one problem
since there are so many products and descriptions when multiple are selected
it changes the format
but it's ok i think ***: heavysixer has joined #arpnetworks jeev: problemski
i need to make one option required.
echo " <b><p>" . implode(', ', $descriptions) . "</b>n";
if i set $descriptions manually
wee, got it ballen: up_the_irons: in the colo biz, whats more expensive power or rack space. In other words, would a high end power hungry server that takes 1U be better, or 4 1U servers that take hardly any power jeev: power i think
depends where you are
you gotta remember, you're probably paying extra for UPS
some people want 20 bux an amp
but if you get a good deal, you may get the rackspace for like 10 bux per U and 10 bux an AMP ballen: yea
ideally multiple boxes would be better
as they're cheaper to buy, cheaper to replace, and offer more redudancy
such as one of these bad boys: http://apcmag.com/dell-uses-via-nano-netbook-chip-to-create-modular-mini-servers.htm jeev: damn
how mush ballen: checking...
the power stats on that box are amazing
25watts fully loaded jeev: jeebus ballen: thats 12 units
perfect for scalling horizontally
give each node a 32G SSD
as much memory as it support
and you officially have one hell of a distributed hash db jeev: how mush monies ***: heavysixer has quit IRC () BeBoo_: not a fan of SSD ballen: still looking
BeBoo_ they're lower power yes? BeBoo_: of course at the cost of speed
tbh, i'd rather a few 15,000 RPM drives myself ballen: whaaa. they are wicked fast jeev: BeBoo_
can i
$products2[] = $items[$key]['name']; BeBoo_: ballen: might want ot research that a bit jeev: $products[] = $products2[] + fart;
or something ? BeBoo_: ssd speed is equiv to like a 4200 rpm drive
jeev: what is "fart" ? jeev: a product
since
#
$items = array( '1' => array( 'price' => 100, 'name' => 'Product 1', 'desc' => 'Product 1'),
#
'2' => array( 'price' => 0, 'name' => 'Product 2', 'desc' => 'Product 2'), BeBoo_: period combines if that is what you are looking for
you just want to add to the product array? jeev: says cannot use [] for reading
yea
i have a required product BeBoo_: no you can't jeev: which i want to add
i want it tobe added in everything but ALL
which i can do BeBoo_: jeev: try $products = array_merge($products, $products2); jeev: hm BeBoo_: is products2 an array? jeev: $products[] = array_merge($productrequired, $products2[]);
can i do that
yea BeBoo_: you can't use [] to read
-_-
it knows that $products2 is an array if you are using that dunction
function
it returns an array jeev: ah
what should i dooo
;/ BeBoo_: http://www.php.net/array_merge
what i said before...
$products = array_merge($productrequired, $products2);
?
don't use {}
[]*
it combines jeev: ahh ballen: jeev: that dell server isn't generally available jeev: ah
BeBoo_
what if $productrequired isn't an array
$productrequired = fart;
$products[] = array_merge($productrequired, $products2); ballen: appears to be only for dell's customers that have some special relation jeev: no error is produced
but it doesn't add the text fart
$products2 = an aray
$products2[]
i have to turn productsrequired into an array i guess BeBoo_: yes
you can't slap just a string into an array
well, you can
if you wanted to
but it won't match up and will likely break your script ballen: BeBoo_: http://it.anandtech.com/IT/showdoc.aspx?i=3532&p=13
"ntel X25-E is nothing short of amazing: it offers at least 3 to 13 times better OLTP performance at less than a tenth of the power consumption of the classical SAS drives. " BeBoo_: thats news to be because i just did a bit of research on that about a week ago jeev: damn ballen: SSD drives have always been faster jeev: i got an ssd in my laptop ballen: especially the Intel's
really the ideal setup would be two SSDs and a set of slower SATA drives in ZFS
ZFS is smart enough to do writes to the SSDs and move it around later
basically big cache drives BeBoo_: i haven't played with zfs yet ballen: its an amazing piece of software
and if by chance you have an application that does a lot of sequential reads/writes SSD owns all jeev: BeBoo_, no go with arraymerge ballen: also since there is not moving parts, reliability goes up a bit jeev: BeBoo_, the thing im tryign to add is in the array as '1'
its just disabled in the post script
cant i just
yea man i should be able to emulate it's checked BeBoo_: ohh
you want to add 1 to which array? jeev: hold up BeBoo_: i'm still kinda lost on how this script is working
hard to help without seeing it
lol jeev: sec, i think i got it
or i got the idea bithash: hello ppl dbgi: hi ***: heavysixer has joined #arpnetworks dbgi: lalala teknicaL: la la dbgi: good tune
it goes well with mine ***: visinin has quit IRC ("what")
ballen has quit IRC (Read error: 113 (No route to host))
heavysixer has quit IRC () dbgi: hiii
slow here tonight ***: heavysixer has joined #arpnetworks BeBoo_: hi dbgi: up_the_irons you around ***: heavysixer has quit IRC ()
bithash has quit IRC (" HydraIRC -> http://www.hydrairc.com <- Now with extra fish!")
timburke has quit IRC (Remote closed the connection)
timburke has joined #arpnetworks dbgi: lalala ***: virtualroot has joined #arpnetworks virtualroot: Its posible pay a VPS with Paypal? jeev: i dont know about that, do you have a paypal debit card? virtualroot: i dont have a credit card, only paypal account jeev: paypal should give you a debit card, no ? teknicaL: I;m sure you have a credit card or bank account to have a pay pal account. In which cause, if you have a bank account, they give you a debit card. =b ***: virtualroot has quit IRC (Remote closed the connection) up_the_irons: The answer to that, for the record, is I do not accept payments directly from Paypal accounts, it must be a major credit card (Visa/MC/AMEX/Discover) ***: coil has joined #arpnetworks coil: is anyone around sroute: probably
... depending on your definition of "anyone" coil: oh i just checked out the faq up_the_irons: hey coil coil: it pretty much answered my question
it was about rdns up_the_irons: what was the question, i'm interested
ah
that's a common one
to survive the rest of the night, I must .. cd $starbucks ***: ballen has joined #arpnetworks
ballen_ has joined #arpnetworks
ballen has quit IRC (Nick collision from services.)
ballen_ is now known as ballen ballen: $git tag rough_draft_v1
fecking thesis dbgi: i have a ? about rdns when your back up_the_irons
up_the_irons i was wondering if i could run my own rdns server if that is allowed jeev: what's some good blogging software
i want to create some sexy political shit
so i could light the ass up of the morons in this country ballen: scanty-redis jeev: huh ballen: if you want some seriously lightweight
software jeev: i want to use my domain
ahmadinejad.org ballen: http://github.com/adamwiggins/scanty-redis jeev: as a blog ballen: thats nice jeev: i love that guy
he's funny and a truth speaker in my opinion
i will be the left wing poster ballen: theres also a couchdb version jeev: and i'll get a few right wing posters on the site too ballen: that version uses redis
and there is also one that uses ActiveRecord
its running: http://sysadminschronicles.com/
but pretty heavily modified jeev: hmm up_the_irons: dbgi: http://support.arpnetworks.com/faqs/main/reverse-dns
dbgi: you can run your own DNS server, sure ballen: up_the_irons, first draft of thesis is done up_the_irons: ballen: :D ballen: v.2 will be done, with new and improved grammar and spelling
by tomorrow up_the_irons: i could read your v1, but i'd make you cry if your spelling and gramar wasn't already fixed ballen: yep up_the_irons: channel poll -- ballen: haven't even read through it
a second time up_the_irons: I was thinking... Look at this: http://support.arpnetworks.com/faqs/main/reverse-dns
then imagine the same question, answer with this layout: http://arpnetworks.com/about
(obviously imagine the "about" stuff is gone)
what is easier to read / understand? ballen: yep up_the_irons: I kinda feel the KB on the support site has "a lot going on"... ballen: agreed very busy up_the_irons: like it belongs on Sun or Dell's site ;) ballen: re-jigger it
plus it would look like it was yours and not hosted somewhere else up_the_irons: I use that support app b/c it was geared toward support, and has stuff like search, ticketing, etc... all built in. but i'm wondering if I should just make my own, simpler, KB on my own site w/ Sinatra, and just make it searchable dbgi: up_the_irons could u delegate rdns to my ip 206.125.172.78?
if that makes any sence up_the_irons: ballen: yeah i hear ya on that... there's some way to change the CSS on that though dbgi: sense up_the_irons: dbgi: your whole /28 ?
ballen: i you know of any Sinatra plugin that makes pages "searchable" (for lack of a better word) ballen: up_the_irons: maybe try to fix the CSS, is that a hosted solution or a app you're running?
uhh
searching...
is just a pain in the balls
in general dbgi: up_the_irons yea if thats ok up_the_irons: ballen: it's hosted, but there's a way to upload your own CSS, or something
dbgi: sure, what rdns software are you running?
ballen: I will make note of it, "pain in the balls" -: ballen working on the same problem ballen: with Sinatra dbgi: up_the_irons gonna be bind9 up_the_irons: dbgi: ok, i'll work on it, gimme a few mins ballen: there is Ferret, http://www.davebalmain.com/ dbgi: coool thanks ballen: with is a ruby search index
which*
which just halls ass in perf up_the_irons: yeah i've used ferret
i've used sphinx more ballen: which one is better up_the_irons: sphinx
thinking sphinx is quite a nice lib: http://freelancing-god.github.com/ts/en/
but i'm purposely avoiding any ActiveRecord within my site (the Sinatra portion, at least)
this is very integrated: http://www.rootbsd.net/faq/
i want my faq to be like that...
not a bunch of different "articles" you have to search for or find in a directory ballen: there ya go, one big ass page up_the_irons: plus if i host my own faq, i can see statistics on it, i can even host mini howto's ballen: let the user search
with their browser -: up_the_irons sense sarcasm ballen: wicked simple app
nah up_the_irons: *senses ballen: seriously
by far the most simple solution
why do anything more difficult up_the_irons: i mean, personally, i hate f*cking click around everywhere to find what i need; i'd rather have it all in one page and hit "/<term>[enter]" (i use vimperator) ballen: wasting time on it when you could be working on something else up_the_irons: ah roger
that is what I'll do then
i kinda like how Sinatra documentation is like that ballen: yea up_the_irons: it's like one page of "Getting started", and then "The Manual"
and that's it
top to bottom jeev: ballen ballen: yea the people behind Sinatra get this whole perfectly minimalist thing pretty well jeev: that scanty thing looks like a headache ballen: heh
jeev: easy as hell up_the_irons: scanty? jeev: i like the sysadminchronicles ballen: checkout tumblr.com if you want a hosted solution jeev: ballen ballen: can customize it fully jeev: i have a million servers
whywould i want to host it elsewhere? :D ballen: its free
and wicked easy jeev: i'll download it, i duno
which database should i use though ballen: up_the_irons: http://github.com/adamwiggins/scanty-redis
Sinatra app jeev: i've never heard of redis ballen: its a Key/value db
that rawks
up_the_irons: its running my blog sysadminschronicles.com
not that exact version, but thats what its derived from jeev: hm up_the_irons: ballen: (reading some scrollback) -- about the colo, hard to say; i think a high end 1U would be cheaper than 4 low end 1U's. "hardly any" power for a 1U would be like 0.5A, at the very minimum, which is still something; a high end 1U would be like 2A ballen: even if the low end 1U was running an Atom CPU drawing like 25 watts
max
also how about squeezing 2-4 servers into 1U up_the_irons: ballen: the Atom may draw only 25 watts, but the main power supply to the box will be a lot more
here's an interesting stat: ballen: nah the whole box draws 25 watts up_the_irons: my one big VM server was using 2 amps before I put in that second Intel Xeon E5430 2.66 GHz Quad-Core bad boy
guess how much it drew after I added the second CPU? ballen: 3 up_the_irons: nope
2 ballen: 4 up_the_irons: the needle didn't move ballen: hmm
interesting up_the_irons: it means the CPU power was negligable ballen: 60watt CPU? up_the_irons: I have 8 7200 RPM drives in there
a ton of fans
2 redundant power supplies
raid controller
NICs
everything ballen: yea up_the_irons: lot of stuff going on