Lin's Blog
|
  • Zh-Tw
  • Ja
  • Posts
  • Categories
  • About

Ngrok - The Tool That Lets You Develop Webhooks Locally Without a Deployed Environment

Ngrok is an essential tool for backend developers. Whenever I develop a website on localhost, webhooks, API callbacks, and OAuth are a real headache. Take my earlier experience developing a Mandrill Webhook to receive email open and send events as an example. Because you have to set the URL in the Mandrill admin panel before you can test, you have to upload the program to a server after writing it to see the results. That has a big impact on development speed. Ngrok was born to solve exactly this problem! ...

Programming
#Ngrok
January 9, 2017 · 3 min

Tired of Typing File Paths? Let the Sublime Text Package AutoFileName Solve It for You!

Among the things I hate most when writing code, typing file paths is definitely near the top. Every time I need to type a file path, such as loading a JS or CSS file in HTML, or opening a file in Python, I have to switch to Finder to copy the file name. But if you are a Sublime Text fan like me, using it for every programming language, then let AutoFileName be your helper! ...

Software
#Sublime Text
January 8, 2017 · 1 min

Siege - A Handy Tool for HTTP Load Testing

As a backend engineer, it’s no surprise that I sometimes want to run a load test on a website. Load testing helps us understand how stable our server architecture is, and to some extent lets us observe how well our code performs. Common tools include ab and JMeter. I don’t think anyone runs load tests by hand (lol). Today I’m going to introduce Siege, a fairly complete yet simple HTTP load testing tool. It runs from the command line and helps you measure how well a website or API handles load. But keep in mind that performance testing involves many layers, and passing a load test doesn’t mean you’re bulletproof! ...

SRE
#Siege #Load Testing
January 6, 2017 · 3 min

How to Test Whether CORS Is Properly Enabled on a Website

With Cross-Origin Resource Sharing (hereafter CORS) settings, JavaScript can get past the browser’s same-origin policy and access resources (APIs) on other domains. But every time I set up CORS, I have a headache working out whether the server was really configured successfully. Sometimes the browser caches CORS results, so even when the server is configured correctly, the request keeps failing no matter how many times you refresh the page. Here I will show you how to use cURL to inspect the headers directly and check whether CORS is enabled! ...

Programming
#CORS #CURL
January 4, 2017 · 1 min

JavaScript Page Load, Focus, UnFocus, and Exit Events

Most people know how to use JavaScript to record when a user enters a web page, but have you ever thought about how to tell when a user has “closed” it? Browsers today show multiple web pages as tabs, so it’s possible the user is actually looking at someone else’s page while yours just sits there. For example, YouTube often runs into this: a user leaves the page open to listen to music, but in fact they’re looking at Facebook… Today I’ll briefly note the JS page load and close events, as well as the focus (entering the page) and unfocus (leaving the page) events. With these events, you can record user behavior for analysis, and even do things like stop playing music when the user leaves the page. ...

Programming
#JavaScript
January 3, 2017 · 3 min

Python Global Exception Handler

Normally, exception handling should not be global, because when you apply exception handling globally, it becomes hard to pinpoint where the problem occurred and handle it. But in rare cases, you do need to write code like this. For example, this time I wrote a Python program to process webhooks. The information the server sends is very varied, so whenever an exception occurs, I needed to print out the environment data so I could debug it afterward. This is exactly when you should use the Global Exception Hook technique. ...

Programming
#Python
January 2, 2017 · 1 min

macOS Screenshot Shortcuts, File Format, and Save Location Settings

One of the reasons I like the Mac is that it comes with many useful built-in features, such as screenshots and image editing. Windows has these features too, but they’re pretty much useless, so you end up installing a bunch of apps anyway. Today I’ll show you that Mac OS already has a very powerful screenshot feature! You can even set where screenshots are saved, their format, and more! ...

Hardware
#MacOS #Screenshots
January 1, 2017 · 2 min

How to Install Unverified Apps on macOS Sierra

Sometimes when we install apps on Mac OS, the system shows the message ““OOO” cannot be opened because it is from an unidentified developer.” In the past, we all knew that you only had to go to the Security & Privacy settings in System Preferences and allow apps downloaded from anywhere. But after macOS Sierra, the “Anywhere” option mysteriously disappeared! In fact, Apple hid this option to keep users from installing malicious programs. But an unverified app isn’t necessarily malicious. Many useful apps aren’t certified by Apple for various reasons. For example, some apps use system permissions, or the developer hasn’t bought a developer program (because it costs money!!!), so they can’t get Apple’s certification. It’s hard to justify not letting us use them just for that, right! ...

Hardware
#MacOS
December 31, 2016 · 1 min

AES Encrypt/Decrypt File on Mac OS

When you need to send sensitive data through Facebook or email, such as a Google API token or a company’s annual accounts, do you really trust those online services? Personally, I don’t. There are too many possibilities, from hacker attacks to poor internal controls at a company that let employees view customer data. Because of these possibilities, I’m not really willing to send confidential data over the internet. But in this day and age, sending data without using services like email or Facebook Messenger is almost impossible. In that case, you can use AES to encrypt the file, and then share the password through a channel you trust, such as a phone call or in person. Or at the very least, send the password through a different channel than the file, to reduce the risk of everything being compromised at once. ...

Security
#AES #MacOS
December 28, 2016 · 2 min

EP Books: What They Sell Is Not Books, Drinks, or Space, but Reading

I had always wanted to visit the EP Books bookstore, which was opened by Dai Sheng-yi, the founder of Wowprime Group, but I never had the time. This afternoon, while I was dropping something off for a friend, I also made my EP Books visit. It really is a place with character. It isn’t a bookstore, because it doesn’t sell books. It isn’t quite a café either, because it’s as quiet as a library. I had assumed it would be a café full of people working on laptops, and that the “book” in the name was just marketing. But once I got there, I found out that what it sells is neither books, nor drinks, nor space, but reading! So this is what EP Books is all about. ...

Life
#Bookstores
December 24, 2016 · 3 min
« Prev  Next 

Categories

All Programming AI SRE Life Hardware Software Blog Travel Web Apps Games Security
© 2026 Lin's Blog · Powered by Hugo & PaperMod