This file contains hidden or 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 vi /etc/ssh/sshd_config | |
#Set the following two options: | |
#X11Forwarding yes | |
#X11UseLocalhost no | |
sudo /etc/init.d/sshd reload | |
sudo yum install xauth | |
#ssh from mac |
This file contains hidden or 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
#/usr/sbin/setsebool httpd_can_network_connect 1 if cannot localhost | |
#/usr/sbin/setsebool -P httpd_can_network_connect 1 if cannot localhost | |
# | |
<VirtualHost *:80> | |
ProxyPreserveHost On | |
ServerName myhostname.com | |
ProxyPass / http://localhost:808/ | |
ProxyPassReverse / http://localhost:808/ | |
</VirtualHost> |
This file contains hidden or 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
wordpress: | |
image: wordpress | |
links: | |
- wordpress_db:mysql | |
ports: | |
- 8080:80 | |
volumes: | |
- ~/wordpress/html:/var/www/html | |
- /static | |
- another_static:/static2 |
This file contains hidden or 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
#!/usr/bin/sh | |
#install calibre | |
sudo yum install libg11-mesa-glx | |
sudo yum install libXcomposite | |
sudo yum install libGL | |
sudo pip install QtGui | |
#MACOS imagemagick 7 not work on any calibre-web | |
#brew install imagemagick@6 --with-liblqr --with-openjpeg |
This file contains hidden or 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 | |
class U_Yahoo{ | |
private function file_get_contents_curl($url) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
This file contains hidden or 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
if (sys.version_info > (3, 0)): | |
from contextlib import suppress | |
else: | |
from contextlib import contextmanager | |
@contextmanager | |
def suppress(*exceptions): | |
try: | |
yield | |
except exceptions: | |
pass |
This file contains hidden or 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
git checkout --orphan tmp | |
git add . | |
git commit -m "init" | |
git push --force --set-upstream origin master | |
git branch -d master | |
git branch -m tmp master |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from PIL import Image, ImageDraw, ImageFont #dynamic import | |
gif='a.gif' | |
img = Image.open(gif) | |
img.save(gif+".png",'png', optimize=True, quality=70) |
This file contains hidden or 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
pip3 install --upgrade git+https://github.com/aerkalov/ebooklib |
This file contains hidden or 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
// use it on mouser over will replace all whitespace when human interacts it | |
this.href='mailto:'+ (this.innerHTML=this.innerHTML.replace(/ /g,'')) | |
/*<a id="e" href="#" onmouseover="this.href='mailto:'+ (this.innerHTML=this.innerHTML.replace(/ /g,''))">abc @ efg.com</a>*/ |