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
>>> ip = "192.168.75.10" | |
>>> a, b, c, d = map(int, ip.split('.')) | |
>>> a == 192 and b == 168 and 72 <= c <= 79 and 1 <= d <= 254 | |
True |
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
server { | |
listen 80; | |
server_name localhost; | |
# ... other default site stuff, document root, etc. ... | |
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ { | |
alias /home/$userdir_user/public_html$userdir_uri; | |
index index.html index.htm index.php; | |
autoindex on; |
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
; Spawn fcgiwrap as the user owning the git repositories, with a socket writeable by nginx | |
[fcgi-program:fcgiwrap_gitolite] | |
command = /usr/sbin/fcgiwrap | |
user = gitolite | |
socket = unix:///var/run/supervisor/%(program_name)s.sock | |
socket_owner = gitolite:nginx | |
socket_mode = 0770 |
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
server { | |
listen 80; | |
server_name projects.hexi.co redmine.codescape.net; | |
root /home/alan/www/redmine.codescape.net/public; | |
include global/restrictions.conf; | |
location / { | |
try_files $uri @redmine_fcgi; | |
} |
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
#!/usr/bin/python | |
import getopt, sys, pprint | |
pp = pprint.PrettyPrinter(indent=4) | |
shortopts = 'h:l:r:' | |
locals = [] | |
remotes = [] |
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
-- A simple IRC bot using http://www.haskell.org/haskellwiki/Roll_your_own_IRC_bot | |
-- as a starting point | |
module HBot where | |
import Data.List | |
import Network | |
import System.IO | |
import System.Console.ANSI | |
import Control.Applicative ((<$)) | |
import Control.Monad.Reader hiding (join) |
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
program foo | |
real, parameter :: A(2, 3) = reshape((/ 0, 0, 0, 0, 0, 0 /), (/ 2, 3 /)) | |
real, parameter :: B(2) = (/ 0, 0 /) | |
real, parameter :: C(3) = matmul(B, A) | |
! 1 | |
!Error: Different shape for array assignment at (1) on dimension 1 (3 and 2) | |
!f951: internal compiler error: in gfc_simplify_reshape, at fortran/simplify.c:5104 | |
! This works in some versions of gfortran: |
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
def schm(word): | |
return 'schm' + word.lstrip("y").lstrip("bcdfghjklmnpqrstvwxz") | |
if __name__ == '__main__': | |
import sys | |
print sys.argv[1], schm(sys.argv[1]) |
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
# This file is sourced by Xsession(5), not executed. | |
STARTGKD= | |
GNOME_KEYRING_DAEMON=/usr/local/bin/start-gnome-keyring-daemon.sh | |
#if has_option use-gnome-keyring-daemon; then | |
STARTGKD=yes | |
#fi | |
if [ -n "$STARTGKD" ]; then |
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
echo "blacklist snd_hda_intel_hdmi" >> /etc/modprobe.d/blacklist.conf |
OlderNewer