参考 很奇怪的事情
cd /m
之后打了一个tab给我提示:
bash: cannot create temp file for here-document: No space left on device
查了一圈之后找到答案:(具体原因不明,需要以后查看)
from sys import exit | |
from pprint import pprint | |
import lxml.html | |
import requests | |
import re | |
url = 'http://i.cantonfair.org.cn/en/ExpExhibitorList.aspx?k=glassware&page=1' | |
doc = requests.get(url) | |
root = lxml.html.fromstring(doc.text) |
参考 很奇怪的事情
cd /m
之后打了一个tab给我提示:
bash: cannot create temp file for here-document: No space left on device
查了一圈之后找到答案:(具体原因不明,需要以后查看)
#!/bin/bash | |
DBUSER="root"; | |
DBPASS=""; | |
DBHOST="localhost"; | |
DB_OLD=mydatabase | |
DB_NEW=clone_mydatabase | |
DBCONN="--host=${DBHOST} --user=${DBUSER} --password=${DBPASS}"; |
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB | |
#/32 = 496630545 = 473MB | |
#/64 = 248315272 = 236MB | |
#/128 = 124157636 = 118MB | |
#/256 = 62078818 = 59MB | |
#/512 = 31039409 = 29MB | |
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762 | |
#/25165760 = 623 # half of max_connections = 1993.6MB | |
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608 | |
#*(3/4) #default innodb pool size = 11922309120 |
rds-modify-db-parameter-group {param-group-name} \ | |
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \ | |
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \ | |
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
--parameters="name=query_cache_type, value=1, method=pending-reboot" \ | |
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \ | |
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \ | |
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \ | |
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \ |
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
{ | |
"cmd": ["php", "$file"], | |
"selector": "source.php", | |
"target": "exec", | |
"variants": [ | |
{ "cmd": ["/usr/local/php5/bin/phpunit", "$file"], | |
"name": "Run" | |
} | |
] | |
} |
<?php | |
/* | |
* Mysql database class - only one connection alowed | |
*/ | |
class Database { | |
private $_connection; | |
private static $_instance; //The single instance | |
private $_host = "HOSTt"; | |
private $_username = "USERNAME"; | |
private $_password = "PASSWORd"; |
First, you should ensure that your username is included in www-data group. If not, you can add your username as www-data group
sudo adduser $USER www-data
After that, you should change the ownership of /var/www to your username
sudo chown $USER:www-data -R /var/www
Next step, you should change permission to 755 (rwxr-xr-x), not recommend changing permission to 777 for security reason