textboard.org

From Commodious Elephant, 2 Minutes ago, written in Plain Text, viewed 5 times.
URL http://axuhongbo.top/paste/view/4d31cb30 Embed Show code
Download Paste or View Raw
  1. <pre>;;; sudo-ext.el --- sudo support
  2. ;; Time-stamp: <2011-01-17 15:52:34 rubikitch>
  3.  
  4. ;; Copyright (C) 2010  rubikitch
  5.  
  6. ;; Author: rubikitch <rubikitch@ruby-lang.org>
  7. ;; Keywords: unix
  8.  
  9. ;; This file is free software; you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation; either version 3, or (at your option)
  12. ;; any later version.
  13.  
  14. ;; This file is distributed in the hope that it will be useful,
  15. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. ;; GNU General Public License for more details.
  18.  
  19. ;; You should have received a copy of the GNU General Public License
  20. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  21. ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. ;; Boston, MA 02110-1301, USA.
  23.  
  24. ;;; Commentary:
  25. ;;
  26. ;; `sudo' support in Emacs.  Currently it has one feature.
  27. ;;
  28. ;; * `sudoedit' command opens files as root using sudoedit program.
  29. ;;   This command needs emacsserver or gnuserv.
  30. ;;   Try M-x server-start or M-x gnuserv-start first.
  31. ;;   Be sure to you can run `sudoedit FILE' in shell.
  32. ;;
  33. ;;; Code:
  34.  
  35. (defgroup sudo-ext nil
  36.   "sudo-ext"
  37.   :group 'emacs)
  38.  
  39. (defun sudoedit-editor ()
  40.   (cond ((and (fboundp 'server-running-p) (server-running-p)) "emacsclient")
  41.         ((and (fboundp 'gnuserv-running-p) (gnuserv-running-p)) "gnuclient")
  42.         (t (error (substitute-command-keys
  43.                    "Not running server. Start server by \\[server-start] or \\[gnuserv-start]")))))
  44.  
  45. (defun sudo-process-filter (proc string)
  46.   (when (string-match "password" string)
  47.     (process-send-string proc (concat (read-passwd "Sudo Password: ") "\n"))))
  48.  
  49. (defun sudoedit (file)
  50.   "Run `sudoedit FILE' to edit FILE as root.
  51. Be sure to you can run `sudoedit FILE' in shell."
  52.   (interactive "FSudoedit: ")
  53.   (let ((process-environment (copy-sequence process-environment)))
  54.     (setenv "EDITOR" (sudoedit-editor))
  55.     (setenv "VISUAL" (sudoedit-editor))
  56.     (with-temp-buffer
  57.       (set-process-filter
  58.        (start-process "sudoedit" (current-buffer) "sudoedit" file)
  59.        'sudo-process-filter))))
  60.  
  61. (provide 'sudo-ext)
  62. ;;; sudo-ext.el ends here</pre>
  63.  
  64. <pre>How in the hell could a man enjoy being awakened at 6:30 a.m. by an alarm clock, leap out of bed, dress, forced-fed, shit, piss, brush teeth and hair, and fight traffic to get to a place where essentially you made lots of money for somebody else and were asked to be grateful for the opportunity to do so?</pre>I sorta know that feel.
  65.  
  66. trying to post to http://textboard.org/mona/58 at about Sat Dec 04 15:20:23 2021 UTC:
  67. <pre>Not "Japanese Culture" related?
  68.  
  69. Based:
  70.  
  71. This post failed before:
  72. http://textboard.org/mona/58/post - titled "502 bad gateway" with the text:
  73.  ____   ___ ____  
  74. | ___| / _ \___ \
  75. |___ \| | | |__) |
  76.  ___) | |_| / __/
  77. |____/ \___/_____|
  78.                  
  79.  error 502
  80.  bad gateway</pre>
  81.  
  82. Trying to paste this paste to https://paste.textboard.org/new at about Sat Dec 04 15:21:23 2021 UTC:
  83. <pre>https://paste.textboard.org/create - titled "500 Internal Server Error" with the text:
  84. 500 Internal Server Error
  85. nginx/1.20.1</pre>
  86.  
  87. This paste was written with the help of https://archive.md/6uSrU
  88.  
  89. This was pasted to http://axuhongbo.top/paste/
  90.  captcha: PNPNJNLI

Reply to "textboard.org"

Here you can reply to the paste above

captcha