This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//php | |
$num = (int) "10"; | |
$num = (double) "10.12"; // same as (float) "10.12"; | |
//mysql | |
update table | |
set myColumn = replace(myColumn, ',', '.') | |
where myColumn like '%,%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STEP 1 | |
convert excel to sql with https://sqlizer.io | |
STEP 2 | |
Add before sql code: | |
SET NAMES 'utf8'; | |
SET CHARACTER SET utf8; | |
STEP 3 | |
past the code to phpmyadmin or save/import it as an sql file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dpkg -P phpmyadmin | |
sudo rm -f /etc/apache2/conf.d/phpmyadmin.conf | |
sudo service apache2 restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TABLE_NAME, table_rows, data_length, index_length, | |
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" | |
FROM information_schema.TABLES WHERE table_schema = "fpkdb1" | |
ORDER BY (data_length + index_length) DESC; | |
TRUNCATE TABLE table_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Try the below command to remove temp files, | |
sudo rm -rf /tmp/* | |
apt-get autoremove //will remove automatically all unused packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="POST"> | |
<input name="field1" type="text" /> | |
<input name="field2" type="text" /> | |
<input type="submit" name="submit" value="Save Data"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new example user. | |
useradd -s /bin/bash -m example; | |
# Now add that user to the Apache group. On Ubuntu/Debian this group is usually | |
# called www-data, on CentOS it's usually apache. | |
usermod -a -G www-data example; | |
# Set up a password for this user. | |
passwd example; | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$result= db_query("SELECT nid FROM {node} AS n WHERE n.type = 'TYPE'"); | |
foreach ($result as $record) { | |
node_delete($record->nid); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simple steps: | |
Search for and install Gdebi Package Installer from the ubuntu Software Center. | |
Download google chrome https://www.google.com/chrome/browser/desktop/ | |
Right click the downloaded Google Chrome .deb file and select 'Open with' and then click 'Gdebi Package Installer' | |
Done! :-) | |
Gdebi will automatically fetch the missing dependencies for you. |
NewerOlder