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
mkdir test_repo.git | |
cd test_repo.git | |
git --bare init |
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
# -*- coding: utf-8 -*- |
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
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("arg1", help="contextual help for arg1") | |
args = parser.parse_args() |
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
>>> from string import Template | |
>>> s = Template('$who likes $what') | |
>>> s.substitute(who='tim', what='kung pao') | |
'tim likes kung pao' |
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 create_and_write_file(filename, data): | |
fd = open(filename, "w") | |
if not fd: | |
raise Exception("Unable to create %s. Check for read-write permissions." % filename) | |
fd.write(data) | |
fd.close() |
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
# Database name : db_name | |
# Password : db_pwd | |
CREATE DATABASE db_name; | |
ALTER DATABASE db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; | |
GRANT ALL ON db_name.* TO 'db_name_user'@'localhost' IDENTIFIED BY 'db_pwd'; | |
FLUSH PRIVILEGES; |
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/pulseaudio -nF | |
# | |
# This file is part of PulseAudio. | |
# | |
# PulseAudio is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# PulseAudio is distributed in the hope that it will be useful, but |
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 part of PulseAudio. | |
# | |
# PulseAudio is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# PulseAudio is distributed in the hope that it will be useful, but | |
# WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
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
# -*- coding: utf-8 -*- | |
import sys | |
if sys.platform.startswith('linux'): | |
try: | |
import readline | |
except ImportError: | |
print "Module readline not available." | |
else: | |
import rlcompleter | |
readline.parse_and_bind("tab: complete") |
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
cat | ssh user@server 'cat - >> ~/.ssh/authorized_keys' |
OlderNewer