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
Information from https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file : | |
Use any character in the current code page for a name, including Unicode | |
characters and characters in the extended character set (128–255), except | |
for the following: | |
- The following reserved characters: | |
< (less than) | |
> (greater than) |
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
;; Time-stamp: <2017-06-23 17:16:36 kmodi> | |
;; Anonymous function aka lambda macro | |
;; v1 - Original | |
;; https://ekaschalk.github.io/post/xi-macro/ | |
(require 'dash) | |
(require 's) | |
(defmacro xi (&rest FORMS) | |
`(lambda ,(--filter (s-contains? (symbol-name it) |
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
#!/bin/bash | |
# | |
# git-mv-with-history -- move/rename file or folder, with history. | |
# | |
# Moving a file in git doesn't track history, so the purpose of this | |
# utility is best explained from the kernel wiki: | |
# | |
# Git has a rename command git mv, but that is just for convenience. | |
# The effect is indistinguishable from removing the file and adding another | |
# with different name and the same content. |
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
# In /etc/login.conf, add | |
$ diff -u /usr/src/etc/login.conf /etc/login.conf | |
--- /usr/src/etc/login.conf 2011-03-10 13:48:59.000000000 -0800 | |
+++ /etc/login.conf 2011-05-08 16:44:01.000000000 -0700 | |
@@ -26,7 +26,7 @@ | |
:passwd_format=md5:\ | |
:copyright=/etc/COPYRIGHT:\ | |
:welcome=/etc/motd:\ | |
- :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ |
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
! To reset: | |
! setxkbmap -layout us | |
! Alt -> Ctrl | |
! Win -> Meta | |
! Ctrl -> Super | |
! Caps-lock -> Hyper | |
clear Lock | |
clear Control |
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/env bash | |
# Time-stamp: <2017-04-27 09:57:21 kmodi> | |
# | |
# Example of using getopt to parse command line options | |
# http://stackoverflow.com/a/29754866/1219634 Limitation: All the options | |
# starting with - have to be listed in --options/--longoptions, else getopt will | |
# error out. So this cannot be used in wrapper scripts for other applications | |
# where you plan to pass on the non-wrapper-script options to that wrapped | |
# application. |
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/local/etc/PolicyKit/PolicyKit.conf | |
# Allow normal users to mount removable media automatically | |
<config version="0.1"> | |
<match action="org.freedesktop.hal.storage.mount-removable"> | |
<return result="yes"/> | |
</match> | |
<match action="org.freedesktop.hal.storage.mount-fixed"> | |
<return result="yes"/> | |
</match> |
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
Source: http://www.huuii.com/people/juan/1301 | |
I want to use sockets under common lisp, so I am going to create a two simple functions the first one serve-socket and the second client-socket, I am going to use usocket library. | |
- Load the library: | |
(ql:quickload "usocket") | |
- Change to usocket library | |
(in-package :usocket) |
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
(defun generate-sitemap (urls) | |
"Creates the sitemap file" | |
(with-open-file (file "/tmp/sitemap.xml" | |
:direction :output | |
:element-type :default | |
:if-exists :supersede) | |
(cxml:with-xml-output (cxml:make-octet-stream-sink file :indentation 1 :canonical nil) | |
(cxml:with-element "urlset" | |
(cxml:attribute "xmlns" "http://www.sitemaps.org/schemas/sitemap/0.9") | |
;; create the tags |
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
#!/bin/bash | |
# | |
# credit: foked from https://gist.github.com/emiller/6769886 emiller/git-mv-with-history | |
# | |
# git-mv-with-history -- move/rename file or folder, with history. | |
# | |
# Moving a file in git doesn't track history, so the purpose of this | |
# utility is best explained from the kernel wiki: | |
# | |
# Git has a rename command git mv, but that is just for convenience. |