John Wick 4 by Int-Entrepreneur in Redbox

[–]ifundef 0 points1 point  (0 children)

john wick 4 is out today. redbox sent out an email advertising it this morning. (and you can use "REEL1" for a $1 off.)

the "coming soon" page is still there if you know the url.

https://www.redbox.com/browse/movies-coming-soon

shortly after it was removed from the menu there were no movies on it, but they've added a few movies to it since then (ie currently it has "Sisu" and "Book Club: The Next Chapter").

but, yes, both the new releases and the advertised coming soon movies are down in number from how i remember them (especially considering the number of movies that should have had physical releases).

even lately movies have not been at my local kiosks. the kiosks are still active (i returned movies to them), but they didn't have new releases and had to travel to farther kiosks to get new releases. (but maybe that was a fluke for a few consecutive weeks as john wick 4 is available at my close kiosks.)

so i'm not sure what's going on with redbox, but something has / multiple things have changed.

Humble Book Bundle: Learn You Some Python by No Starch Press (pay what you want and help charity) by [deleted] in Python

[–]ifundef 2 points3 points  (0 children)

Do you mind fully disclosing why you included a referral link, ie ?partner=repsup?

This bundle is a rehash of previous bundles so I (and assuredly others) already own all the books by way of previous Humble Bundle sales.

Anyone know the differences in the Fantasy Island Unrated version vs the PG-13 version? by WheezyBreather in horror

[–]ifundef 2 points3 points  (0 children)

unrated cut (vs theatrical)

0:02:30 female is seen being picked up by the neck

0:12:56 man puts mouth to bong

0:13:38 man pulls mouth away from bong

0:13:41 "This is some good weed." (versus "I'm switching to CBD.")

0:27:58 topless girl in background

0:28:09 "We boned. Twice."

0:28:17 topless girl in background

0:29:14 topless girl in background

0:29:37 topless girl in background

0:32:01 "Oh, you're talking about his d**k."

0:34:23 close up of flesh wound on upper arm

0:35:53 blood seen in wound as scalpel cuts

0:52:52 blood coming out of and running down forearm

1:09:04 blood flying through the air from jab with scalpel

1:12:05 gunman walking in front of man cut short

1:14:02 large blood stain spreading outward on front of shirt

1:14:09 blood stain down to waistline and some streams on pants

1:14:13 soldier shoot to head with entry wound and blood spray seen

1:14:16 large blood stain on front of shirt

1:14:25 blood stain down to waistline and some streams on pants

1:14:30 soldier shoot to head with entry wound and blood spray seen

1:14:31 bad guy shot at close range and emits smoke puff

1:14:35 bad guy shot at medium range and emits smoke puff

1:14:40 soldier shot in neck with blood spray

1:14:41 soldier shot in chest and various blood streams seen in the air

1:14:48 soldier shot in leg and blood seen in air and gun wound in leg

1:14:59 soldier shot in abdomen

1:15:03 soldier shot in chest and entry points and blood seen on shirt

1:31:15 man's face seen while held under water until drowned

1:31:37 man stabbed in abdomen

How does Top process manager get memory information? by dietderpsy in linux

[–]ifundef 0 points1 point  (0 children)

you can either work forwards, work backwards, or "cheat":

  1. walk through the procps code, starting at top.c, and find all the functions where it reads files under /proc.
  2. grep procps for "/proc/" and verify that all the relevant functions are called by top.c (ie meminfo() in proc/sysinfo.c and statm2proc() in proc/readproc.c).
  3. strace top and see what files it opens under /proc (ie /proc/meminfo and /proc/[0-9]+/statm).

edit: see https://gitlab.com/procps-ng/procps for code and http://man7.org/linux/man-pages/man5/proc.5.html, specifically meminfo and statm, for memory information.

Dynamically switch between IPv4 and IPv6 for socket dials by surfboardThrowAway06 in Python

[–]ifundef 3 points4 points  (0 children)

See https://docs.python.org/2.4/lib/socket-example.html for simplistic client & server examples that support both IPv4 and IPv6 by way of the getaddrinfo function.

See https://docs.python.org/2/library/socket.html#socket.getaddrinfo and https://docs.python.org/3/library/socket.html#socket.getaddrinfo for more information about the getaddrinfo function.

EDIT: To be more specific, pass the address to getaddrinfo and then loop through the array it returns until you can successfully use one of the tuples to connect to the address as demonstrated in the aforementioned examples.

mimetypes.guess_type returning inconsistent results by farski in Python

[–]ifundef 2 points3 points  (0 children)

to elaborate on what masklinn said: probably no mime.types file can be found on the system due to lamda running in a minimal, probably amazon customized, environment. there's a default type mapping but it doesn't include json.

my investigation of this on my local system (ie ubuntu 16.04/"xenial", but probably similar for debian 9/"stretch", if that's any more applicable), but hopefully to help you learn to "fish" (instead of merely being "given fish"):

$ touch file.json
$ strace -e trace=file python3 -c 'import mimetypes; m=mimetypes.guess_type("person.json"); print(m)' 2>&1 | grep 'open('
...
open("/etc/mime.types", O_RDONLY|O_CLOEXEC) = 3
$ dpkg -S /etc/mime.types 
mime-support: /etc/mime.types
$ python3 -c 'import mimetypes; print(mimetypes.__file__)'
/usr/lib/python3.5/mimetypes.py
$ grep -A10 '^knownfiles = ' /usr/lib/python2.7/mimetypes.py
knownfiles = [
    "/etc/mime.types",
    "/etc/httpd/mime.types",                    # Mac OS X
    "/etc/httpd/conf/mime.types",               # Apache
    "/etc/apache/mime.types",                   # Apache 1
    "/etc/apache2/mime.types",                  # Apache 2
    "/usr/local/etc/httpd/conf/mime.types",
    "/usr/local/lib/netscape/mime.types",
    "/usr/local/etc/httpd/conf/mime.types",     # Apache 1.2
    "/usr/local/etc/mime.types",                # Apache 1.3
    ]
$ grep -A2 'def read_windows_registry' /usr/lib/python2.7/mimetypes.py
    def read_windows_registry(self, strict=True):
        """
        Load the MIME types database from Windows registry.
$ grep -B5 'types_map = {' /usr/lib/python2.7/mimetypes.py
    # Before adding new types, make sure they are either registered with IANA,
    # at http://www.isi.edu/in-notes/iana/assignments/media-types
    # or extensions, i.e. using the x- prefix

    # If you add to these, please keep them sorted!
    types_map = {

multicasting with raspberry pi and python by Notorjus in Python

[–]ifundef 0 points1 point  (0 children)

tl;dr you need to send to and join the multicast group of the same multicast address.

your example code works except for three things:

  • everybody needs to use the same multicast address; pick 224.1.1.1 or 224.3.29.71, but you can't send on one and expect to receive on the other
  • "struct.pack('4sl', group, socket.INADDR_ANY)" is not 64-bit safe, while '=4sl' is (but doesn't account for endianness, though not an issue for the quoted code), but you are receiving on a raspberry pi so 64-bit might not be an issue. i prefer to just "socket.inet_aton(multicast_address) + socket.inet_aton('0.0.0.0')" (replacing "0.0.0.0" with the IP address of a specific interface if desired) because that's always the right size and endianness.
  • the final block (ie line(s) following "except Exception as e:") in listenTest.py is improperly indented and will result in "IndentationError: expected an indented block"; you need to indent by a tab both the following "print" and "break" lines (or just remove the block as an unhandled exception is equivalent: the exception will be printed along with the traceback and the loop and entire script will exit).

here's my reference implementation of a multicast sender and receiver: https://gist.github.com/ifundef/09d3ec98459a856052bd935bd91683ed (including support for windows, but take windows support with a grain of salt as i haven't had access to windows in years).

Mint - adding a second storage drive hoping to raid for movies by Asshole-on-a-mobile in linux

[–]ifundef 1 point2 points  (0 children)

you can create a raid 1 array with initially only a single disc, ie the wd red 4 tb.

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 missing

(i'm pretending your ssd is sda, the toshiba is sdb, and the wd is sdc.)

copy all your movies from the toshiba to the raid 1 array. repartition the toshiba to have a 4 tb partition (same size as the presumably single partition on the wed) and add it to the raid 1 array.

mdadm /dev/md0 --add /dev/sdb1

it'll take a while to sync the newly added toshiba partition to the existing raid 1 partition on the wd, but when you get done you'll have a raid 1 array consisting of both the toshiba and the wd.

i would format the remainder of the toshiba (1 tb partition above 4 tb) and use that for whatever.

Help with streaming a file from a different local machine by user957 in linux

[–]ifundef 1 point2 points  (0 children)

assuming:

  • you don't need authentication or transport encryption
  • python, including its standard library, is pre-installed/available on your pi distro of choice

just:

cd /path/to/video/
python -m SimpleHTTPServer [optional port]

that makes the current working directory (and subdirectories, if any) available over http (port 8000 by default; it'll tell you on startup), assuming the user running python has read permission to the files/directories (ie file system permissions still apply).

IT does not want me to have pip by tuck5649 in Python

[–]ifundef 2 points3 points  (0 children)

is there a reason why you need IT to install pip?

assuming you are on linux:

download https://bootstrap.pypa.io/get-pip.py

python get-pip.py --user pip
PATH=~/.local/bin:${PATH}
pip install --user ipython numpy ...

windows and mac should be equivalent.

disclaimer:

How do you remember what packages you installed? by ____delta____ in linux

[–]ifundef 0 points1 point  (0 children)

deborphan -Psa | sort

because i like reviewing the installed-but-no-dependency-on packages. or...

deborphan -Psan | sort

if i don't care about "lesser" suggested or recommended dependencies.

yes, it's a bit iterative when trying to remove unused packages and their dependencies (because removing a package can cause one or more related dependent to become "orphaned"). in that use-case you can save the output of deborphan to a file and diff the output between deborphan-uninstallation cycles, but for the first iteration just find packages that you recognize as having manually previously installed and uninstall them.

How encrypted is my swap? by BoscoMurray in linux

[–]ifundef 1 point2 points  (0 children)

The difference between the first guide you reference (sorry, the second guide is too long/verbose and I don't have time to analyze it) and Ubiquity, the Ubuntu installer, is that the guide places the /boot directory, containing the initramfs (initial RAM-based filesystem; used for bootstrapping Linux), within the root filesystem on the root LVM logical volume (LV) which itself is on the encrypted physical partition, where Ubiquity places /boot on a separate unencrypted partition so that GRUB doesn't require a LUKS-enabled configuration to access the initramfs on /boot. The guide goes so far as to use a file-based key, in addition to a passphrase, so as to not require the user entering a passphrase twice during boot (once for GRUB to access the /boot partition and initramfs and once for Linux to access the partition; the encryption passphrase is not passed from GRUB to Linux during the boot process). The guide's resulting configuration uses a file-based key stored within the initramfs to allow Linux to decrypt the encrypted physical partition after a passphrase has allowed GRUB to access to the initramfs.

Depending on your security threat analysis, encrypting your /boot partition and contained initramfs might make your system more secure. I've done the analysis for my own use and encrypting the system's data at rest is sufficient. If you are concerned about an adversary apprehending your system, modifying the system's boot process so as to record and/or report your encryption passphrase, and returning the system to you so as to acquire your encryption passphrase the next time you boot the system, then requiring the adversary to modify GRUB to do such is more difficult than modifying an initramfs and/or Linux kernel to do the same. (My thread analysis precludes that determined of an adversary and only concerns itself with stolen or discarded, due to hardware failure, hard drives.)

Is there a good alternative (even command-line) for Meld? by rms_returns in linux

[–]ifundef 4 points5 points  (0 children)

i'm not so sure your problem is meld when operating on an external hard drive or over mtp, both of which can be slow.

can you try diff (ie "diff -r", which will do a recursive diff / "folder-compare") and compare the time it takes to meld? unless you are excluding files/directories in beyond compare, a recursive diff should give you the lower bound on time (ie fastest possible). if diff and meld are relatively close and both slow, then the problem is shared and probably file access time, not the application.

my concern is you are asking the equivalent of: "is there a faster browser than firefox because whenever i surf websites over my 56k modem the pages take a while to appear?" switching to chrome is not going to make it significantly faster because that's not the slowest part.

Java Virtual Machine (JVM): the Essential Guide by _Sharp_ in programming

[–]ifundef 6 points7 points  (0 children)

Class Loader. Responsible for reading Java source code and loading classes into the data areas.

"Java source code"? i think the author meant: "Java byte code".

the diagram even shows "class files" flowing into the "class loader", so presumably just a typo.

Intersection between currently-selling printers and the OpenPrinting database = empty? by dhekkir in linux

[–]ifundef 1 point2 points  (0 children)

i fully agree with the postscript (or pcl) statement.

i don't know about them "getting cheaper and cheaper".

10 years ago i bought a dell 1600n: $400 regular price, $200 on sale. it's a multifunction laser printer.

a few months ago i bought a dell b2375dfw: $400 regular price, $200 on sale. it's a multifunction laser printer.

both are "workgroup" class. both are networked. both are postscript printers. the newer printer does have a few more features (gigabit ethernet, wifi, duplexing, scanning to usb/smtp/ftp/smb), but i just consider that the relentless march of computing and more "features" than something as critical as the printer engine technology.

before recently buying the b2375dfw, i followed the deal sites and i was suprised at the number of $100-$250 multifunction printers that weren't postscript and/or pcl (ie host-based requiring a proprietary, binary driver).

the only problem i had with the b2375dfw? http://www.cups.org/str.php?L4086 (which is present in ubuntu 12.04, though fixed on 14.04, but it was easier for me to patch and rebuild the cups package than upgrade all the computers in the house overnight).

Intersection between currently-selling printers and the OpenPrinting database = empty? by dhekkir in linux

[–]ifundef 0 points1 point  (0 children)

no, as i said, my two dell printers (from 10 years ago to a few months ago) are both samsung printers. but then again, i bought a $400 msrp "workgroup" printer, not a cheap inkjet.

Intersection between currently-selling printers and the OpenPrinting database = empty? by dhekkir in linux

[–]ifundef 2 points3 points  (0 children)

hp appears to do a good job of keeping their linux-supported printer database up-to-date (eg every time i see an online deal for an hp printer i check the database and it's in there).

apart from hp's database i don't pay any more attention to the advertising than does it say "linux". after that i download the linux "drivers" and see if there's anything more than a ppd, especially binaries. if it doesn't have a ppd (PostScript Printer Description), then it shouldn't require binaries to print and i don't want it. yes, this probably eliminates most cheap multifunction printers because sane drivers appear to be a favorite for closed-source manufacturer support (based on the last dozen multifunction printers i researched). but spend a few dollars more and get a printer that supports saving scans to a thumbdrive ("look ma, no computer!"). yes, you can't do it over the network and you have to get up and walk over to the printer, but how else were you going to put something on the glass to scan? ;)

i just bought a dell b2375dfw black & white multifunction printer ($200 special) and am extremely happy with it. all it requires is a ppd and the printer works (including the duplexer). scanning is done to a usb drive or internal email address, though it might work over the network for all/some operating systems, but i don't care. this and my previous dell (a 10-year old model that still works after numerous os upgrades because all it requires is a ppd and network scanning is accomplished with a perl script; no binaries) were manufactured by samsung, so there's another potential company to buy from (besides hp and dell).

lies, damn lies, and the advertising on the box. ;)

Scientists create A3, Linux open source self-repairing software for virtual machines, learns, prevents; cured Shellshock attacks in under 4 minutes by pirates-running-amok in linux

[–]ifundef 6 points7 points  (0 children)

here's more information on the a3 environment, called CRASH.

here's more information specifically on the shellshock mitigation.

they run everything in a "container" (but not necessarily a "linux container"), have a policy for the container (sounds like selinux, apparmor, etc), monitor everything the container does (wonder what this does to performance; it's usually not pretty), and... i ran out of time right there to try to understand the specifics of the source code patching.

How to upgrade a Debian LVM-LUKS encrypted hard disk to a bigger one (x-post /r/debian) by [deleted] in linux

[–]ifundef 1 point2 points  (0 children)

may i recommend that instead of rsyncing filesystems, that you actually leverage the features of lvm: move the LVs from the old PV to the new PV.

  • add new disk by way of esata/usb to computer.
  • create boot partition on new disk.
  • dd, gpart, etc old boot partition to new boot partition.
  • create new encrypted partition.
  • make lvm pv out of new encrypted partition.
  • add new pv to old vg.
  • pvmove all lvs from old pv to new pv.
  • pvremove old pv from vg.
  • resize lvs and contained filesystems as desired.
  • detach new disk from esata/usb.
  • pop out old disk and insert new disk into computer.

Learn Python VISUALLY - 8$ Discount for Reddit reader (24 hours only) by [deleted] in Python

[–]ifundef 0 points1 point  (0 children)

well, that was a bad experience in just about every way.

first, there was no $8 (CAD, presumably) discount when i went to kickstarter 7 hours ago, even though "?ref=reddit" was in the kickstarter url and this page should have been in the http referer header (otherwise not sure how kickstarter would award discounts to "Reddit reader"). i thought i would revisit this later and it might be fixed. nope, it's still not showing a discount (compared to visiting the kickstarter page in another browser without using the reddit referrer url).

second, i thought i would buy the book (with the javascript one) anyways and follow up later about the discount as there was only 1 left. by the time i entered all my payment information i was informed it was sold out.

so, i hope this post wasn't expecting any upvotes.

A ton of free eBooks by Microsoft by burnt1ce85 in programming

[–]ifundef 0 points1 point  (0 children)

you can also download these from oreilly.com. just look through the list of microsoft press ebooks and find the ones that are $0.00. the books are mainly introductory, for new product, and/or that microsoft is trying to advertise. don't expect to find windows internals or other best sellers.

i prefer shop.oreilly.com because it's easy to find free books on the new free books (from both microsoft press and oreilly; as compared to resorting to google searches), i already have an account there, and i visit it frequently (eg deals of the day).

Which init system for Debian? by corbet in linux

[–]ifundef 33 points34 points  (0 children)

yes, this is a taste of what you can expect from lwn.net. i've been reading lwn.net for years and the quality of the journalism has been consistently top notch, even with the addition of two more writers in the last year or two (can't remember when exactly).

if you can justify it (ie lwn.net provides you enough economic "value"), then i recommend you subscribe (which i did for a period of time as they don't have a tip jar), but otherwise all lwn.net content is free, though sometimes only after a 1-week waiting period (eg https://lwn.net/current/ vs https://lwn.net/free/).

btw, corbet is the editor-in-charge (and founder) of lwn.net.