Mount: Can’t Find /dev/xvdg in /etc/fstab or /etc/mtab

os: Ubuntu / Linux
terminal: SSH

mount: can’t find /dev/xvdg in /etc/fstab or /etc/mtab

The above is the exact response that my terminal in Ubuntu gave me when trying to send the command:

sudo mount /dev/xvdg

For anybody knowing anything about the mount command in ubuntu, one must not only specify the device they would like to mount to the system, they must also specify the name to give the drive once it’s mounted.

So, the proper command would have been:

sudo mount /dev/xvdg /folder_name_here

 

A few tips that might help you in this process:

To view attached volumes: sudo fdisk -l

To view mounted partitions: sudo df -h

To view a list of folders: sudo ls -la /




NGINX Error: could not build the server_names_hash

server: NGINX

could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64

The Problem

As my server grows, so do the number of server names. You may ask yourself, how many server names could one person have?! www.teition.com and teition.com is only two!

NGINX has a scaleable feature known as Server Blocks (Apache uses the name Virtual Host) (see NGINX examples of server blocks here). These allow a single server to serve more than one domain name. In this way, a single server can have one IP and multiple domain names. I won’t get into the specifics of a deployment process, but rest assured, there are benefits and naturally some drawbacks to doing this.

So, I went to add two server names to a server block under the server context, greatly simplified:

server {
server_name servername.com newserver1.com newserver2.com;
}

Simple enough change, I’ve done it to many blocks before. Of course, after doing this, one must restart NGINX in the console:

sudo service nginx restart

which promptly [fail]ed.

I checked the NGINX server error logs, by default located in \var\log\nginx\error.log and found:

could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64

The Solution

Reading the above error message, seems pretty easy to understand one must increase the size of one of the two. According to NGINX hash documentation, whichever element shows up first in the error log, it is suggested to increase that one.

Thus, for me, this meant changing the server_names_hash_max_size directive. This is located inside the http context, the \etc\nginx\nginx.conf file.

However, when I went to look at the nginx.conf file, there was no existing line: server_names_hash_max_size, but I did find the line: server_names_hash_bucket_size 64; (which was octothorp’d out meaning it was set to default according to the NGINX hash documentation).

I then, just above the ‘server_names_hash_bucket_size 64;’ line, added:

server_names_hash_max_size 700;

Making it just slightly larger then the default size of 512.

side note: if you feel very strongly that I should have set this to 1024, please comment below your reasoning. I fail to believe that a whole 512 block will be reserved for the new hash and and only use the additional 188 that I’ve set above. I like to believe the designers of NGINX wouldn’t allow such a block to be left… But I’m open to correction.

Once this has been changed, a server restart was required:

sudo service nginx restart

Love to hear if this worked for you!

 

Resources:




AUKEY 30000 mAh Power Bank

AUKEY 30000 mAh portable battery power bank

I’ve been experimenting with various power banks over the past years. What this means is both recharging my devices with portable power banks, and also trying to switch my devices over to USB rechargeable.

Without a doubt, this AUKEY Power Bank is pretty damn impressive. It’s got 30000 mAh, which means about 15 phone charges for my Samsung phone. Comparatively, those smaller ones you see that look like a lipstick container can probably recharge the phone once. This AUKEY Power Bank can very easily fit into my day bag and is hardly any heavier than most other power banks out there.

Specs

Capacity: 30000mAh
Micro-USB Input: 5V 2.4A
Lightning Input: 5V 2.4A
Output 1 (Quick Charge 3.0): 3.6V-6.5V/3A, 6.5V-9V/2A, 9V-12V/1.5A
Output 2 (AiPower): 5V 2.4A
Dimensions: 5.9” × 3.3” × 1.1”
Weight: 20.46 oz

Off of Amazon, this will cost $60 CAD.

AUKEY 30000 mAh portable battery power bank

A common question I always field about a mobile power bank is basically: why? Why do I need to carry this when there’s almost always power somewhere out there I can plug in to. The answer is really an understanding of where one finds power. For instance, if I’m on the road.. let’s say on the ferry. I can wander the ferry for 15 minutes looking for one of those power outlets that’s definitely going to be out of the way, stretch my power cable over whoever is undoubtedly sitting right next to it, and then sit there with my phone as it charges up… -or- I can just plug right into my power bank that’s in my day bag and continue enjoying the beautiful day on the ferry without much inconvenience.

Needless to say, living life as a nomad, with electronics (phone, camera, speaker, flashlight, tablet) having a power bank is indispensable. Nobody wants to be stuck running out of time, power dying on the phone, and the only directions to the place tonight is on the phone.

To charge the Power Bank, I plug the Power Bank itself into the microUSB connector end of a cable, and the other end goes right into a charge source (likely a wall plug or car adapter). Nearly the exact same as a smartphone. You can even use a phone power connector (unless you’re using an iPhone). Charge time will take about ~ 6 – 8 hrs from a wall socket, depending on the capacity of your charge connector you’re using. Remember, when fully charged, this can recharge a smartphone about 15 times.

AUKEY 30000 mAh portable battery power bank

The benefit here comes in the fact that one charges up the Power Bank so that it can be used whenever devices run out of power. So, if I were to fully charge my phone and camera with it, then leave the Power Bank plugged into the wall while I went out to get groceries or a walk along the river, I could still have my electronics (fully charged at this point), and be recharging the Power Bank at the same time!

I like to think of this as a paradigm shift in how we use electricity, but perhaps for a lot of us it does sound very logical already. The availability of power storage is the basis of all my future electronic considerations.

AUKEY 30000 mAh portable battery power bank




Formatting Instagram Captions with Spaces

I’ll spare you jibber-jabber about the annoying issues anybody faces when trying to format their Instagram post captions, but let’s summarize it with it’s bloody finniky.

I’ve tried everything, from using text editor, Evernote, Turtl, Word, WordPress, to markdown (as I’m sure you have), but there always seems to be something just a little off – and by that, I mean new paragraph spacing.

Instagram does such a beautiful job with editing photographs, why is it so tricky to recognize new lines? The least they could do would be to allow markdown. Maybe in one foul swoop they’d both make the internet cleaner and help raise the IQ (internet quotient) of the world.

I said I’d spare the jibber-jabber.

4 Things to Try to Make Instagram Captions Look Nicer

1. Don’t Write Copy In Instagram

It’s kind of unanimous that Instagram copy shouldn’t be written in Instagram itself. My editor of choice is using Evernote which I use my computer to write the caption on, then sync it, and a few seconds later, it shows up on my phone and I’m able to copy/paste the text into the Instagram caption space.

2. Remove Spaces at the End of Paragraphs

This one for some reason always gets me. Perhaps it’s because inside of a paragraph, one always uses a space after a period so my muscle memory is pretty solid. So, at the end of a paragraph, after the period, don’t put a space. You’ll still want to press enter, probably two times: once to start a new line, once to create that spacing line.

3. Use Periods for Paragraph Spacing

You may have seen this one, so this tip may be a little bit obvious, but if you use a period for the new line, it usually sticks and makes your paragraph break occur. How is it done? Let’s use tip 2, with a period. So, press enter at the end of the paragraph (without a space at the end of the paragraph), add a period, press enter (without a space after the period), then start typing away with your next paragraph.

4. Find an Editor that Automatically Adds Paragraph Breaks

I’m still testing this one, but I thought I’d add it for those of you who are very frustrated with everything else. I’ve found that if I do my caption editing in the visual editor of WordPress fully, copy/paste it into Evernote, sync it, then copy into Instagram I get my spaces.

My suspicion about why this works is two fold. First, WordPress actually adds a line break in there, even though I can’t really see it. Secondly, WordPress strips out the spaces at the end of a paragraph automatically.

 

That’s it. Do you have any more tips? I’d love to hear.




Increase Your Security at Public Charging Stations

As smartphones get smarter, the battery seems to discharge quicker. Old flip phones could stay charged for a few days with minimal use. Smartphones? A full day and you’re lucky.

This is frustrating for those of us who use their phones heavily. I personally have a phone that when it’s in my day bag seems to discharge it’s battery at about 3x the rate it normally would sitting on my desk connected to WiFi.

By now, many people are carrying portable power packs to give their phone boosts when on the road. I have a few different ones with various capacities that I’m almost always carrying with me these days whenever I’m on the road.

However, some of you may not be here yet, which leaves you scanning almost every room you walk into for an available power source. Personally, I can see this as working ok if you’re hanging around let’s say a library for a few hours, and/or carry a very long extension cable with you everywhere you go.

Enter: Public Charging Station

A popular service that communities and public buildings are now offering is Public Charging Stations. These, I’m sure, are life savers for many people. I’ve sat close to these at times while en-route and have seen how busy they get. The ones I’ve seen come with 2 or 3 prong plug female connections and USB connections.

2 prong plugs are great if you have your 2 prong AC/DC USB plug. But, the security problem here is with USB connections. Most USB cables don’t just have PWR (5V) and GND lines. They also have data lines. Data lines allow communication to occur, data to be sent. This means that when you plug your USB cable into your computer, you can communicate with the device you just plugged in – explore/transfer files, install apps, etc.. This is great if it’s your computer, but what happens if it’s somebody else’s computer? Do you know this somebody else? And what if this somebody else is equipped to do some major compromizing to your phone?

Your Phone’s Just Been Hacked

So, you plug your USB cable into a public USB power port at the airport, and continue to purchase – on your phone – that new shirt on Amazon, then book a hotel at your destination, and log in to check your phone bill to make sure you weren’t getting charged roaming fees.

STOP! Somebody might be watching what you’re doing!

There are countless programs out there that allow me, anonymous hacker, to view your phone’s screen, which is made infinitely easier if you plug your phone right into my computer that has said hacking tools.

You logged into your amazon account and typed in your VISA or PayPal account information into your phone? Yeh, that’s just been logged with my handy little data logger.

Preventing Your Phone From Being Hacked

Obviously you don’t want this to happen. Nobody want’s their personal data compromised (in spite the growing number of people responding to security and personal privacy with the common ‘I have nothing to hide’ remark).

What can you do to prevent your smartphone from being hacked while charging it at a Public Charging Station? I’ve got a few suggestions, but I’d love to hear some of yours in the comments below.

source: Aukey

Charge ‘Dumb’ Battery Packs / Power Banks Instead

Battery packs – those little things shaped like a external hard drive – are ‘dumb’. You don’t use them to buy off of Amazon. They hold power and then discharge power into your USB device. There are even (bigger) power packs that can charge your laptop. So, if you plug your drained battery pack into the Public Charging Station instead of your phone, you have NO risk of your phone becoming compromised.

Now that we’re talking about power banks, let’s spend a little bit of time thinking about how simple and valuable they can be so that you don’t even have to get close to the Public Charging Station in the first place.

Keep Smartphones Smart

Smartphones are only as smart as the software / apps you have installed on them. The common myth that Macs, Linux, or Android operating systems can’t get viruses isn’t true. Anything can be hacked, it’s just a matter of how. However, all operating systems’ reputation depends on have large teams combating all known vulnerabilities so that you don’t have to worry about it.

So, keep your phones smart by upgrading to the latest version of software. Also, don’t install programs unless you know what they’re going to be doing. And if you don’t use those apps anymore, uninstall them. It is incredibly easy to install apps on your phone, so don’t be scared that you’ll never be able to again. If you can’t chances are there’s a far better app out there to do the job.

Keep Your Phone Locked While Charging

Of course, I’m assuming your screen enters into a locked mode when not in use. If it doesn’t, please go and enable that now. Security 101.

It’s not 100% foolproof, but locking your phone stops most apps from really running. Some hacking programs just data log anything that’s been typed or viewed. If your phone is locked, you’re not using it, so nothing will be monitored.

Another point though, is that most likely you don’t want to be hanging around this Public Charging Station all day. So, if you lock your phone and read a book while it’s charging, your phone will actually charge faster. While we’re on the topic of charging faster, let’s also put our phone into Airplane Mode. This disables all your beacons which is essentially putting your phone into low power mode and will greatly reduce your charge time (ie. your phone will charge faster).

Go one step further and just turn off your phone fully when charging at a Public Charging Station. Hard to hack a phone turned off.

Anker USB Power Hub

source: Anker

2 Prong Plug

Using a two-prong (or 3) plug to charge your phone is definitely the safest secure bet. It might not always be possible, but generally if there’s USB power ports, there’s going to be wall plug to plug directly into. Depending on the USB port current (most likely ~ 0.5 A), you’ll also charge much faster if you use a higher current 2 prong plug ( could be up to 2 A) directly into the wall.

This is one thing that I’m always on the lookout for: high current USB charging wall plugs. For USB, high current is anything greater then 1 A. 1 A is good, too. 0.5 A is horribly slow. There is probably a very long thread on Reddit about the effect/deterioration of Li-ion batteries vs. charge current, but at the rate we go through smartphones, extending the battery life isn’t usually everybody’s biggest concern: charge speeds are. So, it’s smart to keep your eye open for these USB wall plugs with a high output rating on them. It’s almost standard on USB ports to be 5 V, aside from those larger power banks that can smartly output up to 12 V sometimes.

If you have a few USB devices that always die on you, you could also think about a USB Hub. This works the same as a one port, except it’s got about 4+ USB connections on it. You plug the 3 prong plug into the wall which connects to the hub, and at the hub, you can connect your USB devices to charge. As above, these will come with various port current outputs, so be cautious when buying them (I’d go for something in the range of 1.5 A output).

Ok, that’s it for tips. Maybe you have some for me?

 

Thanks to Aukey – manufacturer of battery packs and other really cool gadgets – for inspiration on this article with their own article on Protect Yourself From Public Charging Stations To Avoid Mobile Phone Hacking!