Skip to content

Instantly share code, notes, and snippets.

View lechidung's full-sized avatar
⛰️
Go up and never stop....

Johnny Lê lechidung

⛰️
Go up and never stop....
  • Techbase Vietnam Company Limited
  • Ho Chi Minh City, Vietnam
  • 19:55 (UTC +07:00)
View GitHub Profile
@lechidung
lechidung / agent-config.yaml
Created January 2, 2023 09:34
Grafana cloud
## Replace `hostname-spy-amz-fe` -> name filter
integrations:
node_exporter:
enabled: true
relabel_configs:
- replacement: hostname-spy-amz-fe
target_label: instance
prometheus_remote_write:
- basic_auth:
4 4 5 6 6 5 -5 -5 6 -6 6
5 -5 6 4 -3bb 4 5 5 -4 4 -4
4 4 5 6 6 5 -5 -5 6 -6 6
-5 -4 -5 5 -4 4 -4 -4 4 -3 4
4 4 5 6 6 5 -5 -5 6 -6 6
5 -5 6 4 -3bb 4 5 5 -4 4 -4
4 4 5 6 6 5 -5 -5 6 -6 6
-5 -4 -5 5 -4 4 -4 4 -3 4
sudo certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d 'domain.com'
brew install certbot

Describe the network protection controls used by your organization to restrict public access to databases, file servers, and desktop/developer endpoints.

  • Access to the Amazon Aurora database through the network is disabled and standard ports are closed. The database is only accessible through a socket on the server itself.
  • The reverse proxy only serves whitelisted directories that are only from sources controlled by Teecom used (AWS Amplify).
  • API endpoints are password protected (PBKDF2 & SHA512 encryption, salted, and stretched for thousands of rounds).
  • Login credentials are always transmitted securely over SSL.

Describe how your organization individually identifies employees who have access to Amazon Information, and restricts employee access to Amazon information on a need- to-know basis.

  • If all your employees are properly assigned separate users and given only relevant access rights: Access rights are provided to employees based on their role within the company and are progressive, base
@lechidung
lechidung / gist:87e3e27853d39b0806c41539add5c4e7
Created August 17, 2021 01:29
Hướng dẫn cài reset
1. Vào Setting > Plugins
2. Vào Manage plugin repo....
3. Thêm https://plugins.zhile.io
4. Qua tab market tìm Eval Reset để install
{"lineList":[{"name":"\u6771\u4eac\u99c5 (\u6771\u4eac)","code":"2001","param":"st","pf":"13","ln":"2161","st_name":"\u6771\u4eac","valcode":"22828"},{"name":"\u6771\u6210\u7530\u99c5 (\u5343\u8449)","code":"2418","param":"st","pf":"12","ln":"2260","st_name":"\u6771\u6210\u7530","valcode":"22413"},{"name":"\u6771\u798f\u5bfa\u99c5 (\u4eac\u90fd)","code":"6132","param":"st","pf":"26","ln":"6643","st_name":"\u6771\u798f\u5bfa","valcode":"25720"},{"name":"\u6771\u3042\u305a\u307e\u99c5(\u4e80\u6238\u7dda) (\u6771\u4eac)","code":"2262030","param":"st","pf":"13","ln":"2262","st_name":"\u6771\u3042\u305a\u307e","valcode":"22923"},{"name":"\u6771\u4e09\u56fd\u99c5(\u5fa1\u5802\u7b4b\u7dda) (\u5927\u962a)","code":"6701020","param":"st","pf":"27","ln":"6701","st_name":"\u6771\u4e09\u56fd","valcode":"26147"}],"geoList":[{"name":"\u798f\u5ca1\u770c\u798f\u5ca1\u5e02\u6771\u533a","oaza":"","code":"40131","pfName":"\u798f\u5ca1\u770c","pfCode":"40","geoName":"\u798f\u5ca1\u5e02\u6771\u533a","geoCode":"40131","breadcrumbs"
/*** PHP 7 ***/
strlen([]); // Warning: strlen() expects parameter 1 to be string, array given
array_chunk([], -1); // Warning: array_chunk(): Size parameter expected to be greater than 0
/*** PHP 8 ***/
strlen([]); // TypeError: strlen(): Argument #1 ($str) must be of type string, array given
array_chunk([], -1); // ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
@lechidung
lechidung / Nullsafe operator
Last active November 29, 2020 18:18
PHP 8
/*** PHP 7 ***/
$country = null;
if ($session !== null) {
$user = $session->user;
if ($user !== null) {
$address = $user->getAddress();
if ($address !== null) {
@lechidung
lechidung / Match
Last active November 29, 2020 18:18
PHP 8
/*** PHP 7 ***/
switch (8.0) {
case '8.0':
$result = "Oh no!";
break;
case 8.0:
$result = "This is what I expected";
break;
}
echo $result;