Skip to content

Instantly share code, notes, and snippets.

@reanim8ed
reanim8ed / sample.md
Created December 23, 2022 17:35
[Bypass “Your connection is not private” Message] #chrome #ssl

Bypass “Your connection is not private” Message

Click a blank section of the denial page. Using your keyboard, type thisisunsafe. This will add the website to a safe list, where you should not be prompted again.

OR

In the Chrome address bar, type “chrome://flags/#allow-insecure-localhost“ Select the “Enable” link.

@reanim8ed
reanim8ed / sample.md
Last active November 9, 2022 09:04
[Change root password in mysql8] #mysq

Change root password

sudo systemctl stop mysql
sudo systemctl edit mysql

[Service]
ExecStart=
ExecStart=/usr/sbin/mysqld --skip-grant-tables --skip-networking

sudo systemctl daemon-reload
@reanim8ed
reanim8ed / sample.md
Last active February 8, 2023 21:24
[Best practices for images] #web #images #optimise

Best practices for images

[https://www.builder.io/blog/fast-images]

[https://web.dev/top-cwv-2023/]

  • Load the image using an element with the src or srcset attribute. Do not use non-standard attributes like data-src that require JavaScript in order to render, as that will always be slower.
  • If your image needs to be referenced from an external CSS or JS file, you can still include it in the HTML source via a tag. Note that images referenced by inline styles are not discoverable by the browser's preload scanner, so even though they're found in the HTML source, discovery of them might still be blocked on the loading of other resources, so preloading can help in these cases.
  • Add fetchpriority="high" to the tag of your LCP image. If the LCP resource is loaded via a tag, fear not because you can also set fetchpriority="high" on that!
  • Never set loading="lazy" on the tag of your LCP image. Doing this will deprioritize your image and delay when it
@reanim8ed
reanim8ed / sample.md
Created August 26, 2022 14:54
[youtube-dl download mp3] #youtube-dl #youtube #download #mp3
@reanim8ed
reanim8ed / sample.md
Created July 3, 2022 18:34
[Upgrade openssh-server OpenSSH_7.6p1, to OpenSSH_8.0p1?] #ubuntu #linux #openssh #linux
sudo apt update
sudo apt install build-essential zlib1g-dev libssl-dev
sudo mkdir /var/lib/sshd
sudo chmod -R 700 /var/lib/sshd/
sudo chown -R root:sys /var/lib/sshd/
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.9p1.tar.gz
tar -xzf openssh-8.9p1.tar.gz
cd openssh-8.9p1/
sudo apt install libpam0g-dev libselinux1-dev libkrb5-dev
@reanim8ed
reanim8ed / sample.md
Created July 3, 2022 18:10
[Combine multiple columns] #sql
SELECT GROUP_CONCAT(name SEPARATOR '\n') as name, GROUP_CONCAT(value SEPARATOR '\n') as value
FROM `ach_wsal_metadata` meta
LEFT JOIN `ach_wsal_occurrences` oc
ON oc.id = meta.occurrence_id
GROUP BY occurrence_id
select t.teamname,
@reanim8ed
reanim8ed / sample.md
Last active July 5, 2022 07:38
[Remove tracking query strings from url] #nginx

UTM

#remove utm query string
if ($args ~* "utm_") {
    #? in uri? drops the utm query string
    rewrite ^(.*)$ $uri? permanent;
}

FB

@reanim8ed
reanim8ed / sample.md
Last active May 23, 2022 19:35
[Vesta installation in CentOS7] #vesta #centos
  • Update server first: yum update

  • Generate install command from: https://vestacp.com/install

  • Change Vesta port:

    • Change port on VestaCP firewall at https://YourIPAddress:8083/list/firewall
    • Edit /usr/local/vesta/nginx/conf/nginx.conf anc change port here too
    • Restart: service vesta restart
@reanim8ed
reanim8ed / sample.md
Last active April 13, 2022 10:51
[Controller versioning] #symfony

With FOS rest installed:

fos_rest.yaml:

versioning:
    enabled: true
    resolvers:
        query: true # Query parameter: /users?version=v1
        custom_header: true # X-Accept-Version header
 guessing_order:
@reanim8ed
reanim8ed / sample.md
Last active March 27, 2022 19:01
[DirectAdmin - Only allow access for specific IPs] #directAdmin #linux

Only allow DirectAdmin access for specific IPs

Our VPSs with DirectAdmin use 'firewalld' as a firewall by default. In firewalld, you can choose to allow only specific IPs to connect to port 2222. Port 2222 is the port you connect to in order to log in to DirectAdmin.

  • First close port 2222 with the command below (i.e. in reality remove port 2222 from the list of open ports):
firewall-cmd --permanent --zone=public --remove-port=2222/tcp