And some programs need to be in PATH:
https://iankelling.org/git/?p=basic-https-conf;a=summary
https://sallymae.club/git/?p=acme-tiny-wrapper;a=summary
+chost from
+https://iankelling.org/git/?p=fai;a=summary
This repo does not include the repos under /git. In my own version, under /git are links to the .git dirs of the respective repos under the
hardcoded directory in setup.sh: gitroot=/a/bin/githtml. These
state != 'suspect'
SQL
+$db.execute('insert into c values (NULL, ?, ?, ?, ?, ?)',
+ [state,
+ IP,
+ NOW,
+ GOTO,
+ COMMENT_TXT])
if date
new_count = $db.execute(query + 'and date > ?',date)
else
new_count = $db.execute(query)
end
+new_count = new_count[0][0]
if new_count == 1
require 'net/smtp'
def send_email(opts={})
- opts[:to] ||= ENV['USER']
+ opts[:to] ||= 'root'
opts[:server] ||= 'localhost'
- opts[:from] ||= ENV['USER']
- opts[:from_alias] ||= ENV['USER']
+ opts[:from] ||= 'root'
+ opts[:from_alias] ||= 'root'
opts[:subject] ||= "test subject"
opts[:body] ||= ""
send_email :subject => 'new comments on iankelling.org'
end
-$db.execute('insert into c values (NULL, ?, ?, ?, ?, ?)',
- [state,
- IP,
- NOW,
- GOTO,
- COMMENT_TXT])
-
post(md_file)
redir
-#!/bin/bash
+#!/bin/bash -l
# Copyright (C) 2016 Ian Kelling
# This program is free software: you can redistribute it and/or modify
cd "${BASH_SOURCE%/*}/proposed-comments"
all=false
-shell="ssh iankelling.org"
+shell="ssh $(chost iankelling.org)"
while [[ $1 ]]; do
case $1 in
-a) all=true; shift ;;
fi
# we may want to avoid rate limited posts here too.
-sql="select * from c"
+sql="select * from c;"
if [[ $date ]]; then
- date_clause=" where date > cast('$date' as real)"
+ sql+=" where date > cast('$date' as real)"
fi
-echo "$sql"
-$s "$sql" > /tmp/hcomments
+echo "executing: $sql"
+$s > /tmp/hcomments <<<"$sql"
(interactive)
(iankmod-set-state "banned"))
+;; for test comments, or comments we just want to delete from the
+;; db for whatever reason.
+(defun iankmod-delete ()
+ (interactive)
+ (iankmod-set-state "delete"))
+
(defun iankmod-moderate ()
(interactive)
(iankmod-set-state "moderated"))
(define-key map (kbd "b") 'iankmod-ban)
(define-key map (kbd "m") 'iankmod-moderate)
(define-key map (kbd "x") 'iankmod-save)
+ (define-key map (kbd "d") 'iankmod-delete)
map))
<li><a href="git">git</a></li>
<li><a href="https://ofswiki.org">ofswiki.org</a></li>
<li><a href="resume.html">resume</a></li>
- <li><a href="/favorite-stuff.html">favorite stuff</a></li>
+ <li><a href="/favorite-things.html">favorite things</a></li>
<li><a href="ian-kelling-pubkey.asc">gpg key</a></li>
</ul>
-#!/bin/bash
+#!/bin/bash -l
# Copyright (C) 2016 Ian Kelling
# This program is free software: you can redistribute it and/or modify
cd "${BASH_SOURCE%/*}/proposed-comments"
-shell="ssh iankelling.org"
+shell="ssh -oStrictHostKeyChecking=no $(chost iankelling.org)"
while [[ $1 ]]; do
case $1 in
-a) all=true; shift ;;
grep -Eo '^[^|]+\|[^|]+' /tmp/hcomments | while IFS='|' read -r id state; do
#echo "$id -- $state" # debug print
- sqlite3 comments.sqlite "update c set state='$state' where id = '$id'"
+ if [[ $state == delete ]]; then
+ $s <<<"delete from c where id = '$id';"
+ else
+ $s <<<"update c set state='$state' where id = '$id';"
+ fi
done
$shell $PWD/../build.rb