awk

Activity Graph

Page 1 of 1

2017-04-20

[13:59:19] awk: Quit: .

2017-04-16

[07:26:04] awk: Quit: .
[07:31:42] awk: has joined #ruby

2017-04-04

[05:14:22] awk: *.net *.split

2017-03-29

[10:59:00] awk: has joined #ruby
[11:02:09] awk: Hi, I was wondering if anyone could help. This ruby script, https://pastebin.com/WUQPyApM runs and tails a file trying to find a string, the problem is it's to slow and misses the line, yet if I use tail -f /path/to/file/blah.log | grep whatIneed it works... So in bash I have done this https://pastebin.com/NrMDvzer which also works... Please can someone advise what I can do to have ruby read this as I don't wan
[11:02:15] awk: t to use bash
[11:02:26] awk: erp, sorry
[11:13:04] awk: matthewd: sorry to sound stupid, what are you meaning... that ruby script I run with /path/to/file 'CoreConfigurationService STARTING'
[11:13:25] awk: It sometimes catches it, and sometimes it doesn't, but tail -f /path/to/file | grep 'CoreConfigurationService STARTING' gets it each time
[11:15:56] awk: matthewd: I'm watching a logfile, and when I get an entry i'm looking for in the logfile, I'm then happy to move to another systemd process I need to run
[11:16:18] awk: So it's a startPost step on a startup service
[11:16:54] awk: Service starts, then kicks off this script to wait for the entry, if it doesnt display that log entry then there is problems elsewhere (DB related), if it gets the response its good to move to the next service
[11:23:36] awk: matthewd: got it... thanks..

2016-07-10

[04:59:54] awk: *.net *.split
[08:54:10] awk: has joined #ruby

2016-07-01

[19:42:28] awk: Ping timeout: 252 seconds
[19:44:13] awk: has joined #ruby

2016-06-17

[08:43:15] awk: Remote host closed the connection
[08:43:30] awk: has joined #ruby

2016-05-28

[01:14:05] awk: Ping timeout: 260 seconds
[01:15:27] awk: has joined #ruby

2016-05-09

[09:55:10] awk: you probably have multiple versions of ruby installed
[09:55:35] awk: or gem install bundler
[09:56:38] awk: ruby -v
[09:57:24] awk: Read this http://rvm.io/rubies/default

2016-05-06

[16:29:16] awk: Ping timeout: 264 seconds
[16:35:57] awk: has joined #ruby

2016-04-15

[15:25:53] awk: *.net *.split
[17:22:33] awk: has joined #ruby

2016-04-13

[11:37:06] awk: Ping timeout: 264 seconds
[11:38:24] awk: has joined #ruby

2016-03-31

[03:30:20] awk: has joined #ruby

2016-03-23

[19:20:36] awk: Ping timeout: 268 seconds
[19:21:19] awk: has joined #ruby

2016-03-11

[10:42:45] awk: Anyone using Google's Ruby API... When I pull a sheet that contains 3000 lines, it breaks like in the URL here. https://gist.github.com/tripolitrax/48efc085f09bd5136ec4
[11:44:50] awk: shevy: I have just used a big sleep

2016-02-28

[12:56:14] awk: has joined #ruby

2016-02-27

[22:08:23] awk: Ping timeout: 276 seconds
[22:09:40] awk: has joined #ruby

2016-02-20

[20:47:15] awk: has joined #ruby

2016-01-31

[12:25:11] awk: *.net *.split
[12:29:48] awk: has joined #ruby
[16:01:02] awk: Ping timeout: 272 seconds

2016-01-14

[02:53:23] awk: Ping timeout: 246 seconds
[02:53:24] awk: has joined #ruby

2016-01-09

[03:11:55] awk: *.net *.split
[03:22:15] awk: has joined #ruby

2015-12-05

[11:31:20] awk: has joined #ruby

2015-11-29

[22:47:21] awk: has joined #ruby

2015-11-26

[11:38:52] awk: hmm, anyone use the google_drive gem, i'm struggling to find a way to avoid having to pass a token... it's annnoying to have to visit the url , select your gmail account and get a token and insert it before it will do any manipulation on your google sheets
[19:01:48] awk: *.net *.split

2015-11-16

[22:54:46] awk: Ping timeout: 265 seconds
[22:56:17] awk: has joined #ruby

2015-11-10

[14:26:36] awk: Ping timeout: 264 seconds
[14:26:51] awk: has joined #ruby

2015-11-05

[18:45:44] awk: Ping timeout: 272 seconds
[18:46:10] awk: has joined #ruby

2015-10-18

[05:02:53] awk: *.net *.split

2015-10-16

[07:10:24] awk: TomyWork: give me a break , im a noob at ruby
[07:10:38] awk: im trrying and took your advice, I re-did all my code the way you advised
[07:10:57] awk: using CSV.parse, etc... and match key -> value with hashes
[07:14:59] awk: got it working thanks
[07:16:29] awk: TomyWork: I'm going to go through that in my ruby book, because i see it's going to save me allot of time.. im using to much of a 'bash' mentality when using ruby and thats my downfall.. thats why I re-wrote it using the CSV gem and GoogleDrive gem

2015-10-14

[07:15:24] awk: Hi, please can someone assist... https://gist.github.com/anonymous/5dc3dd5221060733169b on line 4, I have a VALUE that I must increment I have tried a few different ways, but what I wan't is for ID to be incremented everytime I run this function .. ID is currently set to "0.succ"
[07:17:09] awk: not worried about SQL injection, this a basic script I run once off to do some data manipulation
[07:17:12] awk: TomyWork: let me try
[07:19:01] awk: TomyWork: well now all fields are set to 1
[07:20:24] awk: TomyWork: nobody is going to use this, it isnt public its for some data manipulation im doing.. the database is going to be blank too
[07:20:31] awk: just trying to increment that ID
[08:39:18] awk: Please can some regex guru help me here... I am returning a a whole bunch of values for SQL... what i'm working from in my paste is 'eachRow' and I'm doing some subsitution.. What I need to do is the following, anytime it finds a string it must put a " in the begining and the end ... but only for strings going into the DB so I', using gsub(/[\z,a-zA-Z]/, '"') I can use $ for the other in the sub too.. the proble
[08:39:24] awk: m I face is that it must only be between ,'s unless it's already wrapped in "blah, blah" for example.. VALUES (45,'active',NOW(),0,1,""ubsistence farmers, fishers, hunters and gatherers","Subsistence farmers, <---- that example because someone did farmers, fishers, .... in a csv file it already wrapped it with "" .. Hope I made that clear cut of code https://gist.github.com/tripolitrax/fe02742954b7d43fb8a6
[10:38:43] awk: guys im still struggling .. I need to go through a file (I wrote a script to download a google sheet to a csv), the csv has headers and values.. I use the header for a SQL insert statement and the values as just that. The problem is in the sheet if someone writes ... Hello, how are you doing ... it comes down as "Hello, how are you doing" .. perfect this will insert into a SQL query perfectly. however, if someon
[10:38:49] awk: e writes .. Hello .. or .. How you doing .. it doesn't contain " " around it so it will not work. I need to find a way to wrap strings so something like gsub(/[^a-zA-Z]/ '"') for example <-- that example is actually overwriting the first line eg: Hello becomes "ello ... so I need assistance building a regex that will loop through all the csv's and the ones that don't already have "" around the string to add, but
[10:38:55] awk: leave the ones that do... I don't want to wrap numeric values though..
[10:52:56] awk: sjums: it doesn't seem to be that way with Google Sheets and using the google drive gem to download and export to csv
[10:53:16] awk: it seems only if someone uses a , it then add's the "" so I need another soolution
[10:58:27] awk: workmad3: thats great and it reads it as an array or hash and has the " " around the values, when I write it to a file its gone ;(
[10:58:34] awk: nnot allot of examples on that gem
[11:08:50] awk: workmad3: you right..
[11:08:55] awk: its just the hash / array showing them
[11:11:45] awk: its just the hash / array showing them
[11:11:48] awk: erp sorry
[11:11:52] awk: *sigh* :(
[11:12:20] awk: then let me move away from CSV and try find a way to use gsub and replace
[11:17:23] awk: workmad3: I dont want to send the data my mysql YET... I have many scripts that pass directly to mysql... my problem here is the google sheets layout and having certain things with a , wrapped with "" and other strings not
[11:17:35] awk: inserting into the DB is the easy part.. this is difficult, i
[11:19:14] awk: workmad3: but I have to do a million modifications before I take th 'few' fields that are in the sheet.. I have major SQL that I have prior to adding this last little piece.. where all I pass at the end is #{sqlValues})
[11:20:03] awk: the problem is the sqlValues the stuff im describing above, not the 99.9% of the SQL stuff that the file already has in it, .. truncate, foreign keys off etc etc
[11:22:51] awk: apeiros: listen i don't want this to turn into an argument you can assume what you want... the way the code is written requires me to regex / gsub and im needing help with that... csv has an option to force ALL output with "" not just fields...
[11:24:13] awk: ok, thanks
[12:50:56] awk: ok, I used CSV .. I pushed it into my File.open and I just used gsub and removed the [] ... all done all working, thanks for the direction
[16:50:13] awk: *.net *.split
[17:12:44] awk: has joined #ruby

2015-10-13

[06:10:12] awk: guys, what is the best way to do this.. I want to replace 000_blah.csv / 0001_blah1.csv ... I'm trying to use gsub to remove just the 000_ (so digits underscore) and the csv .. I tried if tableName =~ /[d+]/ a = tableName.gsub /.*_|\.csv/'' else a = tableName.gsub /\.csv/,'' end return a
[06:38:14] awk: Ox0dea: thanks, sorry I missed your reply, I landed up doing this gsub(/^[a-zA-Z]_|\.csv$/, '')
[06:40:14] awk: Ox0dea: what is the reason for that
[06:40:20] awk: I would like to learn
[06:44:26] awk: Ox0dea: interesting thanks

2015-10-05

[08:04:25] awk: hmm, out of interest, does anyone have a ruby script to export all google sheets to csv ;)
[10:19:09] awk: Anyone use google_drive ruby gem? I have finally got it to auth and have it download the ID of the google sheet to CSV.. the problem is the whole Tile: Blah has 10 sheets, it only downloads the first sheet, any advice
[10:44:53] awk: has nobody here used the ruby google_drive gem ? I really need help spreadsheet_by_key .... export_as_file only takes the first sheet
[10:44:56] awk: not all of them
[10:51:56] awk: ddv I am... I can only get the first sheet. I'm not 100% ssure how to use this gem and there is not much examples out there

2015-09-25

[12:15:23] awk: bougyman: you called?

2015-09-09

[13:03:33] awk: what fucking yourself?
[13:09:27] awk: help you with what
[13:11:03] awk: why do you want to use it
[13:11:45] awk: but why this one...
[13:14:20] awk: I would never use that, but good luck.. i'd go with postfix and use net/smtp
[13:15:33] awk: Bish: hence I said postfix + net/smtp
[13:15:48] awk: I wouldn't trust that as a MTA... someone will exploit it
[13:18:08] awk: Bish: "postfix" to recieve mails...
[13:18:16] awk: net/smtp to speak to the MTA
[13:18:27] awk: I wouldn't trust some dudes 'home made MTA'...

2015-08-27

[08:12:46] awk: hi, i'm a really ruby noob.. i've tried all possible syntax to send mail to multple recipients .. I keep getting illegal address from the SMTP server, i'm using sendmail="address@blah.com; address2@blah.com"
[08:32:07] awk: atmosx: net/smtp .. https://gist.github.com/tripolitrax/0cdbb1ef089176713fbf
[08:32:36] awk: All i'm trying to do is send to two recipients, nothing else.. each way I try the SMTP tells me its illegal, as it's "grouping them" together..
[08:47:22] awk: to the variable supportMail ?
[08:47:51] awk: or the To:
[08:50:51] awk: atmosx: I have tried to parse and array I get this warning: Illegal address syntax from localhost[127.0.0.1] in RCPT command: <address1, address2> from the mail log
[08:55:09] awk: let me use a list then, thanks

2015-07-24

[06:51:11] awk: Hi, please can someone take a look at https://gist.github.com/anonymous/7ab55a033c659586641d ... I have been able to return the output of the databases on my system, I now need to try find a way to loop through (I can write the query) just not sure how I can take the output displayed and run the query against that, excluding 2 databases.
[07:06:11] awk: ljarvis: sorry i'm a ruby noob, so i'm struggling to workout the best method.. in bash I would define the connection "connect" and include mysql -u user -p password 'show databases' for example, then, for db in $connect do ... if [ $db != information_schema ] && .... then mysql query (DISTINCT 'table_.....
[07:11:28] awk: ljarvis: I know things like 3.times in a while loop.. just not sure how to skip a return from an array
[07:14:09] awk: ljarvis: correct
[07:16:07] awk: k, let me try a bit harder
[08:08:31] awk: If someone could please look at https://gist.github.com/anonymous/fb6dbc30662008a4525d ... When I run the command from the mysql client it returns the values correctly, when I run that same query and use puts it changes the output. Please could somebody tell me what silly mistake i'm making to return that result?
[08:14:01] awk: ljarvis: ahh, thanks, I tried that but I put it on the outside of of the " hence ended up with 0.0 .... many, thanks!
[12:01:51] awk: When sending a html e-mail, I am getting _everything_ sent on 1 line.. I want each element to print on a new line ?
[12:09:28] awk: apeiros: sorry, https://gist.github.com/anonymous/b2ce214444b05b235545 ... line 30 (outputs) all databases and sizes.. line 31 I setup a variable to mail out and send it out on line 34.. in my mail i'm getting it like this Database name: accounting - Size in (MB): 3.66 [33mDatabase name: batching - Size in (MB): 3.38 [33mDatabase n ... all on one line, trying to find a way to output each result on a new line
[12:11:20] awk: apeiros: let me check that out, thanks
[12:11:50] awk: apeiros: yup I wanted to maybe call it further down
[12:12:59] awk: I must be doing something silly, let me play a little more
[12:15:05] awk: apeiros: https://gist.github.com/anonymous/7b645d2909b5ad3f8443
[12:18:54] awk: apeiros: I set structure on line 2 def send_mail ... and on line 34 I call it and pass the output

2015-07-23

[11:05:52] awk: erm, ruby noob... Dir.entries("*full*") what is the correct way to list the enteries for anything that contains full in it ?
[11:08:48] awk: jhass: glob doesn't return anything.
[11:09:03] awk: never mind...
[11:09:06] awk: I'm being an idiot
[12:07:17] awk: Guys, 1 little question https://gist.github.com/anonymous/411ad99261f1a28337ff .... that returns 5 (which is correct) however if I change xtrabackup_logfile to xtrabackup_logfile1234 and I puts validate without the count it returns only the other 4, if I use validate.count it still returns 5 .. i'm trying to give myself the count of what actually outputs
[12:30:48] awk: Guys, 1 little question https://gist.github.com/anonymous/411ad99261f1a28337ff .... that returns 5 (which is correct) however if I change xtrabackup_logfile to xtrabackup_logfile1234 and I puts validate without the count it returns only the other 4, if I use validate.count it still returns 5 .. i'm trying to give myself the count of what actually outputs
[12:33:09] awk: apeiros: well i'm from South Africa and thats how we refer to _everyone_
[12:47:40] awk: apeiros: apologies

2015-07-21

[07:13:00] awk: Hello, please advise (ruby noob) say I have $blah = '' ... then I do for example puts "hello" ... puts "goodbye" how do I pipe both hello and goodbye to $blah so I can call $blah later.. $blah < puts... ?
[07:15:15] awk: Ox0dea: well i'm writing different classes and instead of sending an e-mail in each class I want to store each output in a variable and then later I can send_email( "Backup successsful for ${$blah}" )
[07:15:50] awk: perfecto, thanks
[08:15:10] awk: Ox0dea: another question please... I define a hostname eg... $hostname="blah" ... then I have a whole lot of things it does... what I want to do is if #{$hostname} == '' then puts "no hostname" exit 1 ... or abort... else do this...
[08:15:24] awk: What happens is I get the no hostname but it doesnt exit or abort it carries on with the else ?
[09:04:02] awk: Ox0dea: here is what i'm trying to do https://gist.github.com/tripolitrax/34fc3fae4e7821f8e465
[09:04:55] awk: It runs the puts "Not running synchronization for DB02 as no hostname specified" but it doesn't abort or exit or anything, it goes straight to the else
[09:24:29] awk: got it thanks, working now

2015-07-20

[12:37:47] awk: Please can someone help the ruby noob... http://pastebin.com/2RZCW0BA ... when it runs that git, it failed because it doesn't exist ... so I want to use if $? = 1 ... tell me it may be missing... if I remove the whole if .... and I run the script and then do a echo $? I get a 1, so I knoww it's failing.. just not sure why it's not doing the if $? after it's run ?
[12:39:57] awk: require 'git'
[12:40:04] awk: @ljarvis:

2015-07-17

[07:05:03] awk: blah, i'm really struggling to find a way to use rsync (incremental) pulls from a remote ssh server and doing this the 'right' way in ruby.. i'm a ruby noob.. I wrote the script using scp, however I have a problem because scp doesn't have incremental options
[09:41:02] awk: Hi, please assist, ruby noob... http://pastebin.com/As5Ws89x When I run it, it still asks for blah@temp2.local's password:
[09:41:49] awk: I even have ssh keys so it shouldn't ask for a password. but if it does i'm not sure what i'm doing wrong
[09:43:31] awk: shevy: well I'm not sure how to pass the password with rsync, and the session is already open with a password
[09:44:44] awk: shevy: sorry I removed it because I setup ssh keys and I can ssh without a pass
[09:45:03] awk: after $user, I can have $pass
[09:45:56] awk: Net::SSH.start($host, $user, :password => 'blah', :verbose => :debug) do |ssh|
[09:46:01] awk: Still asks for a password
[09:46:33] awk: Ox0dea: ok, any suggestions to point me in the right track
[09:49:38] awk: Ox0dea: if I ssh blah@temp2.local I get on the box ye

2015-07-16

[10:46:51] awk: has joined #ruby
[10:48:20] awk: hi, i'm a ruby noob.. if I have $dir="/home/user" and then I have files = Dir.glob($dir) and puts files it outputs /home/user ... how do I modify either Dir.glob($dir or puts to output /home/user/* without having to put /home/user/* in $dir ="/home/user/*" ?
[11:39:56] awk: @all is there a way with Class: Net::SCP to only transfer files that have changed.. I don't want to use rsync
[12:07:53] awk: anyone can advise on a way with ruby using scp to only upload/download changed files ?
[12:16:49] awk: shevy: m' kay tx