« first day (3119 days earlier)      last day (1886 days later) » 

12:07 AM
I'm feeling rather adventurous ... 4 GB, using DEFLATE algorithm.
hmm... DEFLATE is probably too slow.
I'm curious about this laptop's battery life now...
(swappiness is set to 100)
Using the default LZO, 4 GB max size.
 
12:27 AM
Hmm... as the zram device grows, less physical memory is available for actual application use. It seems I can get up to about 1.7-2.0 GB of swap utilization before we run out of physical memory and the system slows to a crawl.
(with the zram device using ~500-600 MB to store about 2 GB of swap data)
There's a positive feedback loop involved: as the zram grows, more data needs to be swapped into it, and the zram device grows further. This means it could take a while for everything to swap into it and to free up enough physical memory for normal operation.
But the fact that there's less free memory for application use does not help. A zram device taking up 1 GB of physical memory leaves 1 GB minus system-reserved memoey for active usage because apps can't run directly from the swap.
At least it does enable more apps to be kept in memory before swapping to disk becomes necessary.
So... going forward, it seems a sensible max size is something like 1.5 GB.
iostat indicates that some 28 GB of data got written to the zram device. That definitely points to some really bad thrashing.
Yes, zram does impact battery life due to increased CPU utilization, but the impact appears to be lower than using a power-hungry portable SSD as a swap device and performance is a bit better.
 
1:00 AM
The more practical upside is the ability to forego using the portable SSD, which makes this laptop cumbersome to move around while in active use.
I'd suppose that optimal performance would be attained through a combination of a (smaller, e.g. 512 MB) zram device and a swap disk.
 
 
4 hours later…
4:41 AM
@Hennes I see that you are privileged enough to have spare time for sleep
2
It's a luxury that I cannot afford
 
 
1 hour later…
5:42 AM
I got someone using a proxy again to view my site... Another 192.168.x.x address listed as a referral
 
6:18 AM
@CanadianLuke hmm.
Random ideas, but some sort of local cache or ad-block solution maybe?
 
Bob
7:10 AM
@CanadianLuke bwha? context?
 
8:40 AM
@bwDraco I'd suggest when you discuss something like changing swappiness, you either detail how, or link to something detailing how.
It's just useful for those random people who might come accross it and go 'yes, but HOW do I change it?'
Also, interlinkedness is good on the interwebs
other than that, nice writeup
 
morning
 
9:30 AM
Any 'expect' experts?
I am trying to send passwords to a ssh session but smoething isn't matching
child.expect('very-long-host-name>')
errrr, pexpect, asi n python
 
9:45 AM
I mucked with the normal version of expect a very long time ago....
 
10:06 AM
I got around the problem before by just setting up scripts I can via ssh
but really I need pexpect working to keep it 'secure'
 
 
3 hours later…
1:25 PM
and it all works \o/
now I'm doing complicated stuff so it's either called via another script, or directly, parsing the arguements etc
 
1:41 PM
lol
3
Q: Unable to login to ec2 instance after running “sudo chmod 2770 /”

iAmLearningI am new to linux and AWS. I ran sudo chmod 2770 / command on my ec2 instance and after that I was getting Permission denied on everything I was doing(even using ls or cd) So I exited my connection(using cygwin) and tried to re-connect but now I get Permission denied (publickey...

 
2:07 PM
@djsmiley2k ow
 
Bob
@djsmiley2k but why?
 
lol no clue
made me lol
 
3:11 PM
I feel like a real boy
writing real code!
 
your nose is growing
 
well that will just make it easier for the chinese to steal your government's secrets
 
3:48 PM
pre-CoC my removed comment would have received a lot of stars ... now I panicked and deleted it :(
 
something about having a very good time...? ;)
 
no I put "f time"
 
i know
i was trying to be funny
you ruined my joke :(
2
 
lol
I get it now
 
4:06 PM
better than ruining your butt.
/me cares not for stupid coc.
and those coc-heads who try to enforce the silliness.
;D
 
halp
I can't docker
3
so ... I set up a php/apache server in docker "as per guidelines" (php and apache each in a separate container)
but, in the code I need to do a "loopback" HTTP request (the php need to use curl to access the some.thing.test domain
but, while my desktop knows, that thing.test is localhost, the docker's php container does not seem to to be able to reach it
how should I approach this problem?
 
@tereško "desktop" as in the host machine outside of any container?
 
Bob
@tereško How does your desktop know that thing.test is localhost?
Where is that defined?
Is that the hostname of the desktop?
 
@bwDraco yes
 
Docker doesn't expose any ports within containers by default, so the host machine isn't going to see port 80 as it appears to the code in each container.
 
4:20 PM
@Bob company's internal DNS
it's pointing thing.test to localhost
 
Bob
@tereško In that case you'd need to look at DNS resolution from the docker container.
See what server it's hitting.
 
what should I google for?
 
Bob
Actually, Draco makes a good point. And I just realised this whole thing probably won't work.
 
It might not suffice, because company DNS might resolve "thing.test" to 192.168.1.x, which is reachable by the localhost but not by the docker container, as they reside in different networks.
 
4:22 PM
Unless "thing.test" literally resolves to "127.0.0.1" but I don't know enough of Docker network intricacies to be sure it would work then.
 
Bob
If you can, use the special domain name defined by docker that points to the correct IP address to reach the docker host.
 
well, I would need to point thing.test in the "php" container to be the same as apache (compose's internal domain name for webserver) ... if I got it correctly
 
Bob
If you can't, you need to configure docker so the container can reach the host on its loopback interface.
 
It's the best I could find.
I'm not too familiar with the topic but I do know that ports aren't going to be exposed to the host machine unless you tell Docker to specifically expose those ports from within the container.
 
Bob
(I'm looking at this through LXD-tinted glasses cause I'm more familiar with its approach.)
 
4:25 PM
Nor is the host machine's ports exposed to the container by default.
 
Bob
@tereško So, broadly, there's two possible configs: docker can have its own network (so docker <=docker network=> host <=other network=> public internet etc) or they can share a network stack.
In the first config, as far as the container sees it, the host is a separate machine entirely. Localhost will never connect to it.
In the second config, localhost on the container means the host.
 
I think I just need to overide the dns entry php-container
was it possible to use domain names in /etc/hosts files as the "first item" ? (I really dont want to configure dns)
or, I need to merge the apache and php containers into one (I really don't like this option)
 
Does the PHP container need to communicate with the host machine, or only with the Apache container?
 
maybe use docker-compose
 
only apache
 
4:33 PM
I am personally still learning Docker myself so I can't really help you much, but I can still try.
 
and I am using docker-compose already
 
Okay. So PHP is reading the HTML+PHP source, processing it, then sending it to Apache for actual output?
 
apache is proxy'ing the calls to php-fpm
the normal "web shit" works just fine
 
Oh, so there's bidirectional communication between the two containers.
 
the issues start, when the php-fpm need to make a loop-back web request to the site's current domain name
 
4:35 PM
(as in, Apache sends unprocessed code to the PHP container, and it is returned to Apache once processed)
 
yes , that part works
 
@tereško Where is the domain name defined?
 
hmm .... there is a company-wide entry in the DNS for *.thing.test to point to 127.0.0.1, but the some.thing.test isn't actually defined anywhere - it's just a vhost on apache
 
Bob
@tereško I'll say it again: in the default config, 127.0.0.1 is namespaced within the container and is effectively a separate machine from the host.
 
Are the containers linked, bridged, or otherwise?
 
Bob
4:38 PM
Imagine you're running a full VM. VBox, VMware, etc.
127.0.0.1 in the VM guest is different from 127.0.0.1 on the host, yes?
 
Containers do not see the outside network unless you tell Docker otherwise. localhost inside the container is the container itself, not the host machine.
 
@Bob hence, I need to override that DNS entry for php-container
 
Bob
Now you need to either use the correct host IP (which may be accessible via a different domain name), or set up docker such that the container shares the entire network stack with the host.
 
> set up docker such that the container shares the entire network stack with the host
I'm not sure I'd recommend that.
 
@Bob yes, got that part already :D
 
Bob
4:40 PM
(Also the host IP can probably change, so setting up static IP mappings is probably a bad idea.)
@tereško Can you not change the hostname/domain that the script connects to?
 
yes
I think I can
 
Unfortunately, I don't really know enough about Docker to help you much more here.
 
Bob
@tereško Connect to host.docker.internal instead.
See if that works.
 
emmm ./... what do you mean by "connect"?
 
Bob
@tereško Wherever you have some.thing.test, use host.docker.internal instead.
 
4:42 PM
oh, I got it
there is a problem
 
Docker's networking stack resolves that to the host's internal IP address.
 
apache has VHost setup
 
Bob
...urk.
 
it needs the proper name :D
 
Bob
Ooooookay. Plan B.
@tereško Are you using curl from php?
 
4:42 PM
yes
 
Bob
@tereško Manually set the Host: some.thing.test header
 
can I set up domain-aliases in docker-compose?
 
Bob
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: subdomain.hostname.com'));
@tereško Erm... that'd be a question for @allquixotic :P
 
because if I can, then I can just adjust apache config
@Bob holy shit! It actually works that way?!
 
Bob
@tereško That's how all HTTP (1.1+) works
DNS lookup of IP from domain, connect to IP, add Host: header to tell the server which domain was originally requested
It never connects "to a domain" as such
 
4:46 PM
so, the VHost does not actually know the host, that user tried to access
that sounds exploitable
/me takes a note
 
Bob
@tereško Ehm. I don't know about compose, but you could create a user-defined network and specify aliases, apparently.
see --network-alias
but you'd need to set up a network separate from the default bridge
...and I don't know if the alias can be the full domain or only a hostname
 
@tereško yes, it's in the header...
They don't know which one you looked up via DNS
 
Bob
though it looks like aliases can only be hostname, possibly
really, the better solution is to either use a proper public (or 'private', not loopback) IP address for your main domain definition
otherwise you end up with multiple DNS server shenanigans where which DNS server you connect to determines which IP you get back
there's many hacky ways you could get this to work
but if it's not a one-off, doing it properly is probably worth doing
(there's also questions like are you intending to distribute the docker containers/run them on other machines? that would limit how much you can hardcode)
 
 
1 hour later…
6:13 PM
Sooo
An English teacher said "I'm really impressed by Rahul's command of the English language, and have very high expectations from him" and that's the nicest thing anyone has said to me in a loooong time and made me really happy
:)
 
6:33 PM
0
A: How can I identify which physical PC nearby I’m logged in on via SSH?

djsmiley2k Eject the cd/dvd drive Stress the CPU - listen for fan sound. Download a large file, seeing which HDD light stays on. If you have access to a switch - check the mac address table to see where it's plugged in Power it off! using dmidecode see which serial it is, check the serials on the physical ...

did i miss any?!
 

« first day (3119 days earlier)      last day (1886 days later) »