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 perl | |
| #$Id: screen-wrapper.pl 5794 2008-11-30 00:58:30Z erich $ | |
| use warnings; | |
| use strict; | |
| use Data::Dumper; | |
| # Save ssh auth stuff somehwere, then start screen. | |
| my $old_umask = umask (077); | |
| my $k = q(SSH_AUTH_SOCK); |
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
| (require 'cl) | |
| (defun set-env-in-subshells (varname value) | |
| (let ((shell-command (concat "export " | |
| (shell-quote-argument varname) | |
| "=" | |
| (let ((v (shell-quote-argument value))) | |
| (if (and (equal varname "PATH") running-on-windows) | |
| (let ((cygpath-command (format "cygpath --path %s" v))) |
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
| From 2dc764dc55dc47037fdb771d7ed6c201cdeb0976 Mon Sep 17 00:00:00 2001 | |
| From: Eric Hanchrow <[email protected]> | |
| Date: Wed, 11 Jun 2014 21:45:33 -0400 | |
| Subject: [PATCH] * lisp/progmodes/python.el (run-python): Use | |
| read-shell-command. | |
| Conflicts: | |
| lisp/ChangeLog | |
| --- | |
| lisp/ChangeLog | 38 +++++++++++++++++++++++++++++--------- |
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 | |
| from __future__ import print_function | |
| import os | |
| dir = '/etc' | |
| for relative_fn in os.listdir(dir): | |
| abs = os.path.join(dir, relative_fn) | |
| print(abs) |
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
| >>> os.listdir('/etc/') | |
| ['yum.repos.d', 'cgsnapshot_blacklist.conf', 'cron.weekly', '.java', '.pwd.lock', 'xinetd.d', 'statetab', 'init', 'dracut.conf.d', 'ntp.conf', 'cron.daily', 'xdg', 'csh.cshrc', 'resolv.conf', 'sysconfig', 'tmpfiles.d', 'rsyslog.d', 'pam.d', 'asound.conf', 'rsyslog.conf', 'csh.login', 'passwd', 'magic', 'DIR_COLORS.256color', 'yum', 'motd', 'sudoers', 'fstab', 'protocols', 'rc5.d', 'DIR_COLORS.lightbgcolor', 'ntp', 'cgconfig.conf', 'passwd-', 'issue', 'localtime', 'hosts.allow', 'rc4.d', 'smrsh', 'filesystems', 'aliases', 'vimrc', 'pkcs11', 'audit', 'motd.rpmsave', 'update-motd.d', 'rc2.d', 'login.defs', 'pm', 'libaudit.conf', 'ppp', 'subversion', 'environment', 'gdbinit', 'shadow-', 'rc.d', 'cron.hourly', 'X11', 'NetworkManager', 'bash_completion.d', 'cron.deny', 'wgetrc', 'mail', 'inittab', 'logrotate.d', 'securetty', 'iproute2', 'rwtab.d', 'rwtab', 'yum.conf', 'inputrc', 'host.conf', 'dumpdates', 'profile.d', 'ltrace.conf', 'dracut.conf', 'security', 'krb5.conf', 'rc0.d', 'blkid', 'r |
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 | |
| from __future__ import print_function | |
| import re | |
| with open ('/etc/passwd') as inf: | |
| for line in inf: | |
| line=line.rstrip() | |
| if any(re.match(pat, line) for pat in (r'^ntp:', r'^nobody:', r'ftp:', r'gopher:')): |
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
| >>> re.sub(r"<\\nl>","\n", "what <\\nl> is it?") | |
| 'what \n is it?' | |
| >>> re.sub("<\\\\nl>","\n", "what <\\nl> is it?") | |
| 'what \n is it?' | |
| >>> |
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
| (progn | |
| (local-unset-key (kbd "M-/")) | |
| (global-set-key (kbd "M-/") 'dabbrev-expand) | |
| (describe-key-briefly (kbd "M-/"))) | |
| M-/ runs the command hippie-expand"M-/ runs the command hippie-expand" | |
| (pp-to-string | |
| (let (wot) | |
| (map-keymap (lambda (a b) (add-to-list 'wot (cons a b))) global-map) | |
| wot)) | |
| "( |
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 | |
| from __future__ import print_function | |
| import subprocess | |
| output = subprocess.check_output(['/bin/echo', 'it', 'does', 'too', 'work']) | |
| print(output) |
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 | |
| from __future__ import absolute_import | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| class OneWay(object): | |
| def close(self): | |
| print("Here I am, being closed") |