Giantpaper.org

Category: Information Station

It may not be in huge numbers. But by golly, if you need information, you’re gonna get information. 😤

(YMMV on whether or not you found it informative…)

  • Account security, baby!

    Account security, baby!

    1. Use a strong password (16+ characters, combination of letters, numbers, uppercase and lowercase and special characters).
    2. Get a password manager like Lastpass, Dashlane, 1Password or Keepass, so you don’t have to memorize 100 passwords.
    3. Use 2 factor authentication. Most places offer SMS 2FA (where they sent a number code to your mobile number), but using Google Authenticator/Authy is more secure, because phone numbers are hijacked more easily.

    These won’t keep your account from being hacked*, but it can make it harder for bad guys to break in.

    *Your account can still be broken into if there’s a security exploit, or the software/online service does something stupid like store passwords in plain text. But even if the online service stores people’s passwords correctly, it’s still a good idea to change your password. Better safe than sorry. (Choosing a new password is easier if you have a password manager.)

    (Also I’d like to note that people throw the word “hacking” around too lightly. If someone’s account was broken into because they have a weaksauce password, it wasn’t really hacking. Their account just had a weak password. 😐)

  • Demonstrating GeSHi using GeSHi

    Demonstrating GeSHi using GeSHi

    How I added GeSHi to GPORG. Here I will demonstrate using GeSHi (for prettification purposes).

    <?php
    
    function sexy_code ($a, $content) {
    	$attr = shortcode_atts(array(				// sets the defaults for each attribute so we don't run into errors if we're missing any
    		'lang' => 'html',						// default language is HTML
    		'start' => '1'							// which line num to start on
    	), $a);
    	
    	$content = strip_tags($content);			// remove wpautop() formatting from the snippet
    	
    	$array = explode("\n", $content);
    	$tab = null;
    	$t = 0;
    	$pos = null;
    	
    	foreach ($array as $i => $line) {
    		$code = $line;
    		if (strpos($line, '//') !== false) {
    			list($code, $comment) = explode('//', $line);
    		}
    			if (preg_match("#\{|\($#", $code)) {
    			$pos = 'after';
    			$t++;
    		}
    		elseif (preg_match("#\}|\)$#", $code)) {
    			$pos = 'before';
    			$t--;
    		}
    		$tab = ($t > 0 ? implode("", array_fill(0, $t, "    ")) : null);
    		$line = ($pos == 'before' ? $tab : null).$line.( $pos == 'after' ? $tab : null);
    		$array[$i] = $line;
    	}
    	$content = implode("\n", $array);
    	$content = preg_replace("#(    +)(\n)#", "\\2\\1", $content);
    	$content = str_replace("    }", "}", $content);
    	
    	$content = preg_replace("#\&amp;([a-z0-9]+);#", "&\\1;", $content);
    	$content = str_replace('&lt;', '<', $content);
    	$content = str_replace('&gt;', '>', $content);
    	
    	//echo secret_output ('test HTML',$content);
    	
    	$lang = $attr['lang'];
    	$geshi = new GeSHi($content, $lang);
    	$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);	// type of line numbers
    	$geshi->enable_classes();					// turns on classes so we can prettify thru CSS
    		if ($attr['start'] != 1)				// if you specifically mentioned which line number you want the snippet to start on
    	$geshi->start_line_numbers_at($attr['start']);		// ...set it here
    	
    	$r = $geshi->parse_code();
    	
    	$r = str_replace('<ol>', '<ol class="no-custom">', $r);
    	$r = preg_replace("#^<pre>#", '<pre class="wp-block-code">', $r);
    	
    	return $r;
    }
    add_shortcode( 'code', 'sexy_code' );			// shortcodify!
    
    ?>

    (See the doc on WordPress’s shortcode API if you haven’t already.)

    To use in a post…

    [code lang="php" start="2"]<?php echo $fun; ?>[/code]

    …will get you…

    <?php echo $fun; ?>
  • Choose chocolate or plush – not live animals this Easter!

    Choose chocolate or plush – not live animals this Easter!

    DID YOU KNOW….bunnies can live for 8-12 years? If you get a tiny, cute baby bunny for your 8 year old, the bunny will still be with you when said child heads off to college. Not tiny anymore, maybe not cute1 and chances are, with a lot more attitude. Think teenagers that never grow up.

    1Okok, I might be biased, but I think bunnies are cute at any age. 😅 I tend to favor the older ones especially.

    They need to be spayed or neutered by a rabbit-savvy vet

    Even if you have a non-breeding pair or a single rabbit, you will have a lot of problems on your hands.

    • Unaltered rabbits tend to be a lot more aggressive and territorial. The Monty Python bunny is not too far from reality (though with less flying leaps).
    • 80% of unaltered female rabbits end up getting cancer (uterine and/or ovarian) and end up dying at an early age. (Poor Daisy is one example. đŸ˜˘)
      More info: Spaying and Neutering

    Rabbits poop A LOOOOT.

    Their digestive systems are always turned on and need to be constantly going 24/7. They accomplish by eating boatloads of hay. So if a bunny stops eating after 24 hours, they’re already at death’s door.

    And the chickens…

    I’m not too familiar with chickens, so I won’t give chicken trivia. Though it’s the same as bunnies. You think you’re getting a cute, baby animal then a year later, you have a full-grown chicken. D:


    Now if you’re actually interested committing to 8-12 years as a bunny/chicken parent, you’ll need to do some research. There are some good resources online that can help. Check rabbit.org for bunnies, and on Facebook. There are some local rescue groups–the Bunny Brigade who I linked to in the Daisy story above is also really good.

    As for finding a rabbit, the months following Easter is a good time to start looking at shelters and rescues for unwanted, “throw-away” pets. This is usually when people bought these critters start to think “what have I gotten myself into?” and will want to get rid of them.

    (I always support adopting rather buying rabbits. They are the 3rd most euthanized animal in shelters.)

    Source: a bunny volunteer of almost 4 years at the local animal shelter here. We’re no-kill and more often than not, overcrowded, so I’ve seen hundreds of bunnies of different ages, temperaments and health conditions go in and out of the shelter.

  • I now use a VPN for all my devices

    All because of this. Earlier I was using the built-in VPN that came with Opera, but since I sometimes use browsers for other things, I wanted a VPN to cover all web browsing activity (and I am a bit leery of free VPNs). So I bit the bullet and got a year of Private Internet Access. So far so good, though I’m noticing some problems…

    Windows 10 only:

    • On startup, after Windows fully boots, it takes a REALLY long time for it to load and start. The first 5 times or so I tried to get it running manually (even though it’s supposed to start automatically), it would take a while to connect, then disconnect. And other times, the software/launcher thing just wouldn’t start. I eventually got it running and connected.

    Android (not sure about iOS):

    • Pokemon Go does not work with a VPN. :/ Each time I tried to get it running, it would say “Cannot login”, and the retry button would loop back to the “Cannot login” error message. Turning off the VPN lets me in the game. (Ingress, PoGo’s predecessor has no problems with a VPN, but it also runs on older code.)
      • There is a setting in the PIA app where you can exclude certain apps like PoGo from the VPN. I tried it, and it sometimes works and sometimes doesn’t. Not sure if it’s a VPN issue or what.

    Windows 10 Mobile:

    • There is no PIA app for W10M, so I had to enter the settings in manually under Settings > Network & Wireless > VPN. One of the biggest problems is that after a few minutes, the VPN disconnects. I found that the VPN can stay connected much longer if I turn off wi-fi (and leave it running on data), and then turn it back on. But it only stays connected for less than 8 hours. It seems to me to be more of a W10M thing than a PIA thing. I don’t think people should have to do these workarounds for something so simple as keeping their VPN connected, so hopefully MS will fix this soon.

    iOS only:

    • Just after I put PIA on my iPad Mini, and let it go into sleep mode, I woke it up and saw that the VPN had disconnected. Lolwut. I turned it back on, and haven’t had problems with it disconnecting since.

    (FYI, I didn’t link to PIA’s site, since I didn’t want it to seem like I was endorsing them, though you can find them by Googling them. They seem to work the best for me, but might not be the case for everyone else–ex. they don’t have a trial version available, and only a 7 day window where you can get a refund if you don’t like it. So you only have 7 days to decide if it’s what you really want. If you’re looking for a VPN, check out this chart that someone made, with a detailed breakdown of each VPN’s strengths and weaknesses. Also you can check out r/VPN for more info on VPNs.)