Chop green onions to 5-cm (2-inch) pieces. Thinly slice shallot.
Line a fine mesh over a large heatproof bowl.
Add oil into a large pan (or wok). Add shallots or onions into one side and green onions on the other side.
Cook over medium heat until the oil is brought to a boil. Press ingredients with a pair of tongs to submerge them in the oil.
Turn to medium low heat. Cook for 40 to 60 minutes, or until the shallots turn golden brown and the green onions turns dark brown. Check the pan after 30 minutes. Gently flip the ingredients with a pair of tongs to ensure even cooking. Keep cooking and check the pan every 10 minutes. When the onions turn golden, they will start to cook rather fast – so watch closely at this stage.
Remove the pan from the heat immediately when the ingredients are cooked, as the residual heat will keep cooking the ingredients and they can be easily burned.
Transfer the fried onions and the fried green onions to the fine mesh over the heatproof bowl, gently press with the back of a spoon to drain extra oil. You could also drain these two ingredients separately, to use them in different dishes later. Once cooled, transfer them to a airtight container.
Once the oil has cooled off completely, transfer it to an airtight jar. Store it in the fridge up to 3 months.