Business vector created by fullvector — www.freepik.com

Have you ever been wondering why your application slow even tough you already fix your application code?

Performance of the application is not depend on application itself. Application and database need to be tune together. For example, imagine 100 customers enter very big fancy restaurant (application) and there is only 2 waiter available (database). How can 2 waiter serve all the customer without keeping the customer in queue for long period? End up, the customer left the restaurant and never visit again.

Here is my 2 cents of tips to speed up database query based on my experience.

Table Indexing

Indexes is…


Man vector created by upklyak — www.freepik.com

Bloating codes in single place would be devastating. It would be tons of duplication and unreadable codes which give your code maintainer a headache 😅.

So, i would cover how i go with Slim Controller and Fat Model

Skinny Controller basically means move all business logic, database logic and non response related logic to somewhere else and leave the controller clean and neat.

Fat Model basically means put only database related logic in the model instead of controller and make it as reusable method.

Don’t get me wrong. Fat Model doesn’t actually fat. …


Hi guys, having fun with TryHackMe CTF again. So, here is the write up and guideline to pass this SafeZone challenge. This CTF room is designed by CTF lover for CTF lovers.

Room: https://tryhackme.com/room/safezone
Level: Medium

Task: No help / hints available. Need to CTF all the way to root

Lets get started

As usual, start the machine and open the IP in browser


Having fun with TryHackMe again. So, here is the write up and guideline to pass this Biohazard challenge.

Room: https://tryhackme.com/room/biohazard
Level: Medium

Task: A CTF room based on the old-time survival horror game, Resident Evil. Can you survive until the end?

Lets get started

As usual, start the machine and open the IP in browser


Having fun with TryHackMe again. So, here is the write up and guideline to pass this VulnNet challenge.

Room: https://tryhackme.com/room/vulnnet1
Level: Medium

Task: Can you take advantage of the misconfigurations made by VulnNet Entertainment?

You will have to add a machine IP with domain vulnnet.thm to your /etc/hosts

Lets get started

As usual, start the machine and open the IP in browser


Photo from https://tryhackme.com/room/sqhell

Hello guys, having fun with TryHackMe again. So, here is the write up and story guideline to pass this SQHell challenge.

Room: https://tryhackme.com/room/sqhell
Level: Medium

Task: Try and find all the flags in the SQL Injections

Lets get started

As usual, start the machine and open the IP in browser


Having fun with TryHackMe again. So, here is the write up and guideline to pass this Ninja Skills challenge.

Room: https://tryhackme.com/room/ninjaskills
Level: Easy — Intermidiate

Task: Practise your Linux skills and complete the challenges.

Lets get started

As usual, start the machine and open the IP in browser


Photo by Ferenc Almasi on Unsplash

I believe in the world of NPM, you encounter problems that are hard to solve. Has it ever made your head spin trying to execute npm run build on your server or your local environment? For example, like getting the below error message.

Killed
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! project-nuxt@1.0.0 build: `nuxt build`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the project-nuxt@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be…


Having fun with TryHackMe again. So, here is the write up and guideline to pass this Bounty Hacker challenge.

Room: https://tryhackme.com/room/cowboyhacker
Level: Easy

Task: You talked a big game about being the most elite hacker in the solar system. Prove it and claim your right to the status of Elite Bounty Hacker!

Lets get started

As usual, start the machine and open the IP in browser


As stated, laravel-cors package allows you to send Cross-Origin Resource Sharing headers with Laravel middleware configuration.

Every time you alter origins, ports, etc.. in the cors.php, you need to push to git and if you have gitlab runner or any auto deployment script, it would be take sometimes to update in production.

The simplest answer is Cache.

Let’s create a new ServiceProvider named as CacheCorsServiceProvider

class CacheCorsServiceProvider extends CorsServiceProvider {}

If we take a look at CorsServiceProvider,

...
...
protected function corsOptions()
{
$config = $this->app['config']->get('cors');
}

the corsOptions get the cors setting from the config and pass it to…

Hafiq Iqmal

Software Engineer at Teratotech.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store