Skip to content

Instantly share code, notes, and snippets.

View methbkts's full-sized avatar

Metin Bektas methbkts

  • Paris, France
  • 01:32 (UTC +02:00)
View GitHub Profile
date.timezone = Europe/Paris
upload_max_filesize = 2G
post_max_size = 2G
memory_limit = -1
max_execution_time = 0
max_input_time = -1
@methbkts
methbkts / com.homebrew.update.plist
Created February 8, 2022 01:27
Homebrew Autoupdate for macOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.homebrew.update</string>
<key>ProcessType</key>
<string>Background</string>
<key>ProgramArguments</key>
<array>
@methbkts
methbkts / fetch.js
Created November 5, 2019 16:15
Sample to Fetch API
fetch('some-url')
.then(handleResponse)
.then(data => console.log(data))
.catch(error => console.log(error))
function handleResponse (response) {
let contentType = response.headers.get('content-type')
if (contentType.includes('application/json')) {
return handleJSONResponse(response)
} else if (contentType.includes('text/html')) {
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

Numbers :

type description range length exemple
tinyint -128 to 127 (0-255) 28
smallint -32768 to 32767 (0-65535) 216
mediumint -8388608 to 8388607 (0-16777215) 224 ---
int -2147483648 to 2147483647 (0-4294967295) 232 ---
bigint -9223372036854775808 to 9223372036854775807 (0-18446744073709551615) 264 ---
decimal store exact numeric values, best for business uses --- --- ---
sudo a2enmod rewrite
sudo vim /etc/apache2/sites-available/000-default.conf
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
@methbkts
methbkts / Change MySQL root password
Last active September 5, 2019 12:17
How to change MySQL root password in Ubuntu Bionic (dev, don't use in production)
sudo mysql -uroot
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '0000';
mysql> exit;
sudo service mysql restart
@methbkts
methbkts / bionic.sh
Last active January 10, 2024 14:56
#!/bin/bash
#Quel ip?
echo -n "Entrez l'adresse ip que vous desirez utiliser : 192.168.33."
read -n 2 ip
echo
cat > Vagrantfile << eof
# -*- mode: ruby -*-
# vi: set ft=ruby :
#!/bin/bash
#Quel ip?
echo -n "Entrez l'adresse ip que vous desirez utiliser : 192.168.33."
read -n 2 ip
echo
cat > Vagrantfile << eof
# -*- mode: ruby -*-
# vi: set ft=ruby :
#!/bin/bash
#Quel ip?
echo -n "Entrez l'adresse ip que vous desirez utiliser : 192.168.33."
read -n 2 ip
echo
cat > Vagrantfile << eof
# -*- mode: ruby -*-
# vi: set ft=ruby :