« first day (1671 days earlier)      last day (3281 days later) » 

12:02 AM
Ah. I see
@NathanOsman Would a setup like this work for storing credentials?
class Gmail:

	def __init__(self):
		self.username	= 'user@gmail.com'
		self.password	= 'passwordlolnoonewilleverguessthis!'

	def grabData(self, password=False, username=False):
		if username:
			user = self.username
		if password:
			pswd = self.password
		return (user, pswd)
Then use this:
import creds

credentials = creds.Gmail()

user, password = credentials.grabData(True, True)

print (user)
print (password)
 
Not exactly, there's a bug in your script.
return (user, pswd)
 
Oh?
Oh true
 
user is only defined if username is True.
 
Exactly. Just caught that as you said it :D
 
12:11 AM
But, removing that, would it work?
 
It should... but why the need for a class?
You could just create a file like this:
USERNAME = 'me'
PASSWORD = 'password'
...and then do:
from creds import USERNAME, PASSWORD
 
Oh, true...there I go again and making it more complicated than I need to :P
 
I like your class though.
For anything more complicated, having a class is probably the way to go.
 
lol :)
Today's the first time I've really done anything with classes.
 
Classes in Python are fairly easy to create (unless you're doing something twisted with metaclasses).
 
12:17 AM
Yeah, I'm liking them now that I know how to use them :D
They never really clicked with me before, but make sense now.
from credentials import USERNAME, PASSWORD as credsUSER, credsPASS
Oh wait. Duh. Being overly complicated again :P
 
I think you meant:
 
postgresql is complicated to do per-database access controls... (sorry to interject, i'm just complaining for the sake of complaining)
 
from credentials import USERNAME as credsUSER, PASSWORD as credsPASS
@ThomasW. It's still the best RDBMS in existence :P
 
Oh. So it would've worked, I just had them in the wrong spots :P
 
Yup.
@ThomasW. And if you think that's bad, you should see what file/directory access controls look like on Windows. O_o
Multiple layers of complicated abstraction.
 
12:20 AM
@NathanOsman didn't say otherwise, it's just really painful to add user restrictions for databases, such that DBA users have access to all, the database user has access specifically as do webclients and DB-specific administrators/owners, and nobody else has db access
@NathanOsman i spent 20 minutes tweaking pg_hba.conf to restrict access to my user's database, but give my user access to everything locally
 
on my one server i have two web services, and i have to do similar lockdown
 
Only DB I've ever used is SQLite with Python
 
mantisbt == mantis bug tracker. forum == forums user.
both are dedicated to those web services and don't have superuser
so headaches ensue.
pg_hba.conf gets complicated then, since local and localhost are permitted, but not remote connections from elsewhere
and i have to do individual lockdowns on databases :/
i like postgres, i like mysql, postgres permissions are more rigid, but mysql connection and access control is easier.
i have services that need one or the other but enough services to require both :/
maybe i should put the db on a separate server :/
 
@NathanOsman Is there a way to manually separate the commit message into the main thing and that subtitle thing?
 
12:31 AM
@RPiAwesomeness don't include the -m argument. It'll bring up a text editor. First line will show at the top there. Any line break will likely bump it down. I can run a test though if you want
i still have a github test repo xD
 
Oh? I'll try that.
 
Awesome. Thanks :)
 
@RPiAwesomeness git commit -am will imply the commit message you provide is going to be on the first line. Strangely enough, if you just do git commit -a it'll pop up your default CLI text editor (nano here) and the first line will be the short message. You can add more to the rest.
 
I figured that out, thanks for testing it out for me :)
 
12:35 AM
you're welcome :)
 
BTW, just glancing over the code I have thus far, what do you think? It's basically tutorial code, so it shouldn't be too bad...
 
havent looked yet :)
too busy tweaking my postgres locally on my laptop here
 
I figured, that's why I included the link :D
 
trying to set up default reject rule for connections and only have explicit allow xD
 
Ooo fun
 
12:37 AM
i'm not a python expert so I can't comment
i just know some git because of many multiline commits I've made
(mostly in private repos)
 
Ah.
@NathanOsman Your thoughts on my code? I'm mainly concerned on how I'm using the class.
 
Sorry, just finished supper.
@RPiAwesomeness I'll take a look.
 
That's fine. I'm just curious if I'm writing it well or not.
 
ask @NathanOsman or something, I think they're the python person here right now
 
@RPiAwesomeness overall, great job. I just have a few minor tips.
 
12:41 AM
This is my local postgres access control for my local users so far. And I have a site on my local computer that handles issue tracking for me privately, and it's a headache to add more roles :/
 
Thanks, feel free to fire away :)
 
in case you care about why i was busy with postgres :P
(gist will blow up in 20 minutes)
 
First of all, any code that does anything outside of a function or class should probably be in a "if __name__ == '__main__':" block.
That way it won't be executed if someone imports the module.
But will still be run if someone runs that particular file.
 
Just changed that :)
 
12:43 AM
Oh? I see.
Will fix that, thanks :)
 
Actually, other than that, it looks great.
One design suggestion, formatMessage() could be made a method of eMessage.
 
Cool!
I'll look into that.
 
I should also clarify naming conventions in Python - class names usually start with a capital letter.
But I see what you did there with eMessage :P
 
So, should it be EMessage?
 
Technically, that would be correct.
It's not a hard-and-fast rule.
But it's a convention.
Your script doesn't use them, but if you ever want to add a private method to a class (a private method is one that the class uses but nothing outside the class should use), it is customary to prefix the name with an '_'.
 
12:51 AM
:p
 
lol
I've done that before
 
very wise man
 
@Seth Do you like Irish/folk music?
 
@RPiAwesomeness Sometimes. Most of the time?
 
Look up the group Scythian. They're pretty good :)
@NathanOsman What do you think? I made the changes you suggested. github.com/RPiAwesomeness/Keyboard-Mail-Desktop/blob/master/…
 
12:59 AM
Looks good. One other suggestion:
rtrnMsg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s"
		% (self.fromaddr, ", ".join(self.toaddrs), self.subject,
				content))
return rtrnMsg
Could be changed to just:
return "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s"
        % (self.fromaddr, ", ".join(self.toaddrs), self.subject, content)
No need for the separate variable and () around the statement.
 
I opened YouTube and saw this on the front page:
 
It could? Cool!
 
Don't know how it got there, but it's hilarious!
And now I cannot remember why I needed YouTube in the first place..
 
@Seth lol, that is actually pretty funny
 
;p
Anyway, back to important stuff..
 
1:03 AM
hm, I find it a bit confusing that a message object is sending a message
 
@Chan-HoSuh My code?
 
yeah
 
Why would that be confusing?
 
so there's two main things I see going on, 1) creation of a formatted message 2) sending of it
there's no reason to tightly couple those two together in one object
anyway, just my thoughts... if it's not confusing to you, that's the important thing :)
 
I can sorta see what you mean, but I think it's fine. You understand what's going on, correct? I'd rather not re-arrange that code again :P
 
1:08 AM
yeah I understand (both code and not wanting to re-arrange). Just something to think about for the future
 
hey I do see something horribly wrong though :( You're using Python 3
 
Thanks for the feedback though :)
....You're joking, right?
o.O
 
np, and... just joking about the Python 3
 
I figured :)
 
1:11 AM
I do have a funny story about Python 3 though
A friend of mine got a job some time back and he was told, "Learn Python immediately"
so the several days he had until the job started, he was studying the Python documentation
then right before the job started, we had a coffee and he had brought this stack of documentation he was reading
"I'm all prepared now"
so I'm flipping through it and I'm like, "Hey you guys using Python 3 huh"
and he says, "Well, what else would we be using?"
so I told him about Python 2
I don't think it made a big difference, but it did make him sweat a bit :D
 
probably would have been worse the other way around
 
huh, good to know
 
plus you get in the habit of making not mixing spaces and tabs ;)
 
hehe, luckily I got in the habit (relatively) long ago
 
lol
Tabs all the way
And single ticks.
 
1:16 AM
O.o
 
Oh dear. I just may have started a flame war
Can anyone see here why I'm getting the unexpected indent error?
	def send(self, msg):
		#username 	= input('GMail username: ')
		#pswd		= input('Password: ')
		# Deprecated by credential storage method
		#(from credentials import USERNAME, PASSWORD)
		#try:
			#with smtplib.SMTP('smtp.gmail.com:587') as server:
				#server.ehlo()
				#server.starttls()
				#server.login(credsUSER, credsPASS)
				#server.set_debuglevel(1)
				#server.sendmail(self.fromaddr, self.toaddrs, content)

		#except Exception as e:
			#print(e.args[0])
			#if len(e.args) >= 2:
				#print(bytes.decode(e.args[1]))
 
sigh, was hoping to fix my code before Game of Thrones started
 
Oh wait
@Mateo Why the googly eyes?
 
lol
 
1:22 AM
is it in formatMessage? Looks like you have multiple lines with an indent
 
I figured it out. The % was on the wrong line for the return statement in formatMessage()
 
Tabs that input spaces. /Iwin
 
yay for ide's ;)
 
@Mateo I don't like IDEs.
They make me work in projects.
 
1:27 AM
@Seth well, I'm really talking gedit/sublime/atom at this point...
 
that's why managers like IDEs :D
 
ah, yes. I use Atom a lot
 
wheeee, unity and lightdm explodified.
>.>
 
But, technically speaking, Atom is a text editor :p
waits for xkcd link
 
shhh - don't tell the managers...
 
1:28 AM
Oh well. Bug will wait till tomorrow. Good night all
 
@Mateo oh, right, good point.
lol I'm sure someone could come up with a dilbert comic about that.
 
2:03 AM
wow I'm having a dilbert moment
remoted into a pc
for work
in the middle of debugging I get a "your computer is going to be restarted warning"
can't get rid of it
it's counting down
 
2:55 AM
0
Q: Python smtplib and MIME Multipart/MIME Text code not working, but not returning error

RPi AwesomenessI have a project I'm working on that uses the Python 3.4 smtplib and MIME Multipart modules. Basically, my code isn't working, but it's not returning an error, it's just stopping and not displaying any changes. My code is available here and the code that doesn't seem to be working is available h...

Argh. This bug will not go away
 
3:19 AM
Oh @Seth! Tek Syndicate is coming out near you (Seattle area)
 
@RPiAwesomeness 0.o
Is he doing some kind of event or something?
 
Yeah
No, he's moving out there
 
orly?
 
Yeah. He mentions it in the most recent Tek
 
Neat.
Where is he located now?
 
3:24 AM
New England area
 
Oh I see. Big move.
 
You don't seem too enthused :P
 
Well, I live in Michigan. I don't really care that much where he lives so long as they make videos :)
 
lol. I don't really watch the syndicate anyway, although it is interesting to know he's moving out this way.
I wonder why.
Maybe I'll watch the video ;P
 
4:23 AM
[ SmokeDetector ] Bad keyword in body, bad keyword in title: The best procedure to Lose Weight Effectively? by kajgyo Rbid on askubuntu.com
 
 
2 hours later…
5:58 AM
[ SmokeDetector ] Bad keyword in body, bad keyword in title: Neuroflexyn advanced formula is built to give you a boost of energy by Bryan Decker on askubuntu.com
 
6:37 AM
0
Q: connecting to virtualbox ubuntu from osx extremly slow

merlinI am running ubuntu 10.04.x as guest on virtualbox from osx x 10.10.x host It works (kind of), but after working a while with it and also after power sleep it can get almost unusable slow. It looks like an IP-Problem. My setup: ubuntu has 2 network cards. One over dhcp for internet access o...

 
6:52 AM
[ SmokeDetector ] Bad keyword in body, bad keyword in title: tudies have shown that respecting Neuroflexyn by Usfo Kutu on askubuntu.com
 
 
1 hour later…
8:20 AM
[ SmokeDetector ] Bad keyword in body: Demystifying The Top Fat Loss Product? by thuobyo Eios on askubuntu.com
 
@Seth Hey Seth, LOL. I just installed Debian 8 GNOME. MATE is not too good in the Debian Live DVD.
 
8:49 AM
Is that correct? "Rebooting after installing a new desktop environment is recommended anyway."
 
Depends. If you're adding a new one, probably not needed. If you're nuking your old one and installing a new one, yes.
 
@JourneymanGeek I think so too.
0
A: Install GNOME Desktop Ubuntu 15.05

cl-netboxOpen a terminal and execute : sudo apt-get install gnome sudo dpkg-reconfigure gdm ( choose gdm ) sudo reboot

 
9:20 AM
15.05 is not released yet so off topic >:)
2
@A.B. well. "recommended" I would answer "yes". "Needed"? No.
 
@Rinzwind exactly, off topic :)
 
9:49 AM
@A.B. Why was my post downvoted ? There are different opinions on the necessity to reboot. I removed my post to revert my reputation. Generally I just wanted to help.
 
@cl-netbox How should I know why you got a downvote.
 
I got one downvote for the answer and one for the discussion with you.
 
@Chan-HoSuh yay, forced reboots!
 
One for the discussion?
@cl-netbox A discussion can not be downvoted.
 
10:08 AM
@A.B. ok - I lost 2 reputation by downvote - do you know how this could happen ? - I think I did nothing seriously wrong and to get sanctioned for helping is not very motivating. As we know in ubuntu often there are different solutions that work. I take this case for getting to knownthe reason, because the same (downvote for a different but correct answer) already happenend to me before.
 
@cl-netbox Restore the answer and wait for upvotes. This is a community and no one can say why someone spread a downvote. Maybe he did not sleep well or trouble with his children or the weather is bad. Do not be annoyed them. This is life. One finds something good, the other bad.
 
10:43 AM
@A.B. Thank you - I will try to learn to participate well and cope with the habbits in this community. Can you tell me why the post shall be "off topic" (see your reply to @Rinzwind above) - was that a serious note or is this some kind of humour ? I assume ubuntu 15.05 was meant to be ubuntu 15.04.
 
@cl-netbox That was a joke. :)
 
@cl-netbox it was a joke! :D
15.05 would be a May release of Ubuntu >:)
 
How can I revert my xmodmap settings?
Do I have to log out and log in again?
 
What do you think? is this device powerful enough to run Ubuntu touch? amazon.in/YU-Yureka/b?ie=UTF8&node=5606984031
 
solved
 
10:58 AM
0
Q: Add ArchLinux to Ubuntu dual-boot

user3298319I would like to dual boot ArchLinux with my Ubuntu. I would like some hints at how to do it without messing my partitions too much. Presently, my Computer partition scheme goes like this: (Ubuntu only) sda sda1 [boot loader] sda2 [root] sda3 [swap] sda4 [home] If I ...

 
@Rinzwind Is .xinitrc a good place for xmodmap ./~Xmodmap?
0
A: Use Alt_L as Space

A.B.You don't need a script for that. Search for the right keycodes with: xmodmap -pke | grep Alt_L xmodmap -pke | grep Super_L Open the file ~/.Xmodmap nano ~/.Xmodmap Place your mappings, eg.: keycode 64 = space keycode 133 = Alt_L in this file and test it with xmodmap ~/.Xmodmap Then...

 
@A.B. ehm dont know >:)
 
@Fabby Is .xinitrc a good place for xmodmap ./~Xmodmap?
@Rinzwind thx =)
 
kos
11:13 AM
@A.B. Judging from the name I guess it loads X?
 
Well, let's see if the answer is accepted.
 
11:30 AM
yay Bloodborne 2 endings done 1 to go
 
0
Q: installing mongodb with linuxbrew

Syd AmirI want to install mongodb with brew in ubuntu 15.04 but despite several attempts to install i can't do that, even if I completely remove homebrew and reinstall it. when i type in terminal : brew install mongodb says : ==> Installing dependencies for mongodb: go, scons and completely fine for ...

 
11:49 AM
@A.B. Not really. Not all DMs read it. Your best bet is probably ~/.profile (though that will also be read by non-GUI programs).
 
12:16 PM
Well. Okay, found a bug in ClamTk. I can't actually configure the Scheduler part, it just resets itself.
 
What means this in an answer: <!-- language-all: lang-bash -->
@terdon ok, thx
 
@A.B. It's telling the site to format any code as if it's BASH commands.
Also, I think my laptop has finally started going down hill :(
More than usual that is, it has been getting visibly progressively worse of the past week or two
 
@RPiAwesomeness Is this documented somewhere?
 
Yeah...somewhere. Let me find it.
 
203
A: Syntax highlighting language hints

Jeff AtwoodNote that this question is a bit obsolete, because we now infer prettify language type based on the tags. See more: Changes to syntax highlighting This is now implemented. In addition to tag inference (a recent change), you can manually specify the language as a hint to Google Code Prettify. T...

 
12:23 PM
^ that
 
@terdon I have a new favorite question :)
 
12:41 PM
Well, I may have solved one bug, but in turn introduced another. Wee coding! :D
 
12:59 PM
o/
Greetings from Vivid! :D
 
1:28 PM
@ByteCommander since the Beta 2 :)
 
Since half an hour! :)
 
coward :P
 
user136984
It funny, I posted this question:
 
user136984
0
Q: Transfer bookmarks from Chrome to Firefox

ToroidalI have currently got Google Chrome and Firefox installed, but I want to switch to Firefox so I want to some how transfer my mass collections of bookmarks from Chrome to Firefox, so is there any way of doing this? Perhaps if I export all my Google Chrome bookmarks into an HTML file, can I import ...

 
user136984
1:30 PM
And then someone answered it with an answer that worked.
 
user136984
But when I was just about to accept it...
 
user136984
They deleted it! :D :P
 
@ByteCommander do not be angry. ;)
 
I am not.
I am just still sad about my broken laptop...
And busy with school! >:P
 
@terdon r u here ?
 
1:35 PM
@BlackBlock Yup
 
ah then why the notify-send didn't work ?
 
So, could you paste the output of crontab -l here?
 
ok sec
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
 
@BlackBlock please join me here so we don't bother the others.
 
1:51 PM
>.<
I'm such a genius some times...
Turns out the reason the code wasn't working was because I had told it to connect to mail.google.com instead of the proper smtp.gmail.com
 
@RPiAwesomeness Let me help you!
;D
 
Indeed
 
user136984
So does nobody know anything about this then? :)
 
user136984
0
Q: After upgrade to 15.04 from 14.10 get 'sysfs write failed /no_turbo' error from OSSEC HIDS

ToroidalI have got OSSEC HIDS (2.8.1) and I have enabled email notifications. I recently upgraded from Ubuntu 14.10 to Ubuntu 15.04, and am now very regularly receiving this error alert from OSSEC HIDS: OSSEC HIDS Notification. 2015 Apr 26 19:40:32 Received From: Bath-Towel->/var/log/syslog Rule: 1002 ...

 
user136984
I get literally am receiving 100s of these errors! :D
 
2:03 PM
@Toroidal Me not! :) No errors with Vivid within the last hour...
 
user136984
@ByteCommander But I bet now that you do not have OSSEC HIDS monitoring your syslog and sending you email notifications about its contents, or that you are monitoring syslog yourself all the time.
 
user136984
As I said before, I'm sure everyone gets lots of problems with computers, it's just that I actually notice most of them! ;D :P
 
@Toroidal No. Because you may also bet that my second nickname is not "ParanoidPanda"... ;)
 
user136984
Anyway, it's not the error that bothers me, it's my inbox getting filled up by the alerts that does! :D :P
 
You and your problems...
I wish mine were as unimportant as yours.
 
user136984
2:07 PM
Well, I've got someone possibly hacking me at the moment! So I can't imagine much worse problems in the computing world.
 
user136984
But I'm sure that you have them! ;D :P
 
user136984
If you say so, because I really don't know what the worst problem is! But I'm sure that I will one day! ;D :P
 
user136984
Wait, now I'm talking to myself again!
 
user136984
facepalm...
 
user136984
Damn it!
 
user136984
2:08 PM
Not again...
 
@Toroidal May I help you too?
;D
 
user136984
@ByteCommander Now you've just gone and given me more work analysing the possible bunny threats in there! :D :P
 
Deviantart is NO malware site!
 
Stupid SMTP :P
Why art thou sending QUIT smtplib?
I ask thee not to!
It just does this:
reply: b'250 2.1.5 OK t50sm16299778yho.11 - gsmtp\r\n'
reply: retcode (250); Msg: b'2.1.5 OK t50sm16299778yho.11 - gsmtp'
send: 'data\r\n'
reply: b'354  Go ahead t50sm16299778yho.11 - gsmtp\r\n'
reply: retcode (354); Msg: b'Go ahead t50sm16299778yho.11 - gsmtp'
data: (354, b'Go ahead t50sm16299778yho.11 - gsmtp')
send: 'QUIT\r\n'
and hangs.
:P
Stupid smtplib
It seems to get the go-ahead from GMail, and then just QUITs and hangs. No messages, no errors, no output whatsoever :P
Oh dear. Now Gmail's mad at me for "too many login attempts"
Sighs
 
@RPiAwesomeness Time to create a set of dummy accounts?
Or a chance to relax and listen to some Rock music...
 
2:22 PM
Perhaps.
 
user136984
Be back in a moo!
 
user136984
Just switching browser!
 
@Toroidal (@ParanoidPanda) How do I disable IPv6 whenever my VPN is connected?
That is a question you should be able to answer...
 
user136984
2:42 PM
@ByteCommander There is probably an answer to that here.
 
looking...
 
Well, I've resolved one error (possibly) but, again, another one has cropped up to take it's place :P
 
Aaaah I hate it, downvote without comments.
 
@A.B. Yup, that was me.
Your script is running the same find command 3 times, and it fails on weird file names.
 
it fails?
@terdon But I have tested it.
 
2:52 PM
@A.B. Try it on a name that contains a newline.
touch foo$'\n'bar
 
@terdon is this a case for -print0?
 
@A.B. Yup.
 
Crap, I've thought about it.
 
user136984
Well, I have successfully migrated from Google Chrome to Firefox! Which is a good thing for my paranoia! ;D :P
 
user136984
@ByteCommander It would be good if people could have a sort of 'nickname' which would be another name that people could hail them with! ;D :P
 
user136984
2:58 PM
You'd know what mine would be!
 
I use find and xargs now only with -print0
 
@Toroidal Experience with sudoers file?
What is the syntax error here:
Cmnd_Alias IP_SWITCH = sysctl -w net.ipv6.conf.all.disable_ipv6=1, sysctl -w net.ipv6.conf.all.disable_ipv6=0
 
user136984
@ByteCommander Sorry, not enough to tell you what the error message mean!
 
That's the line, not an error message!
 
I have to say, github is quite fun
 
3:03 PM
A line inside /etc/sudoers
 
user136984
@ByteCommander Oh... I thought you were saying it was the error message! :D
 
Fixing bugs, on the other hand, is not! :D
 
user136984
@ByteCommander And what error are you given?
 
No... I want to run the IPv6 disabling without sudo passwords.
 
user136984
Oh...
 
3:04 PM
Well, I edit sudoers with visudo.
It just tells syntax error and the line.
 
user136984
Right...
 
And that was the line.
 
user136984
@ByteCommander: So is there a specific command then that you want it not to prompt sudo with?
 
@Toroidal The two sysctl commands from the line above.
Oh, I have an idea: absolute paths!
No errors now.
Trying if it works...
YAY! :D \o/
 
user136984
@ByteCommander: Don't you just do "<$USER> ALL=NOPASSWD: <command1>, <command2>"?
 
user136984
3:08 PM
Oh, good, it worked then I gather. :)
 
user136984
Probably not what I said, but anyway! :D
 
user136984
:P
 
No idea. I now have a Cmnd_alias for those two commands and a line "username ALL=(ALL) NOPASSWD alias"
 
user136984
@ByteCommander Well, if it works, then just leave it alone! ;D :P
 

« first day (1671 days earlier)      last day (3281 days later) »