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/ruby | |
`psql -U postgres -t -l`. | |
split(/\n+/). | |
collect{|l| l.split(/\s+\|\s+/)[0].chomp().strip() }. | |
filter{|l| (! l.nil?) && l !~ /^\s*$/ }. | |
each{|db| `psql -U postgres -c 'ALTER DATABASE "#{db}" REFRESH COLLATION VERSION;'` } |
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/ruby | |
require 'socket' | |
(listen_addr, listen_port, single_file) = ARGV; | |
server = TCPServer.new(listen_addr, listen_port) | |
client = server.accept | |
req_file = client.gets.split(" ")[1] | |
if single_file == req_file | |
client.puts <<~ERESP | |
HTTP/1.0 200 OK\r | |
connection: close\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/perl | |
# taken here: https://github.com/elimirks/simpleHTTP | |
use IO::Socket; | |
# Command-line args IP PORT FULL-FILE-PATH | |
# request must be as http://localhost:8181/FULL-FILE-PATH | |
($listen_addr, $listen_port, $singlefile) = @ARGV; | |
(-r $singlefile) || die "File '$singlefile' not found."; | |
my $sock = new IO::Socket::INET( |
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
# BASE={$BASEDIR:-/home/ikben/eenproject} ## root folder for project | |
fsnotifywait -qPmr -e 'moved_to,create' --format '%w%f%0' --no-newline ${BASE} | while IFS= read -r -d '' file | |
do | |
# here goes any code you want | |
host="developpeur@127.1.1.100" | |
rsync -uavz --del lib mix.* "${host}:eenproject/" | |
done |
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
# https://www.mikeperham.com/2023/09/11/ruby-http-server-from-scratch/ | |
# №1 | |
class TimeServer < GServer | |
def initialize(port=10001, *args) | |
super(port, *args) | |
end | |
def serve(io) | |
io.puts(Time.now.to_i) | |
end |
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
rm -r /etc/pacman.d/gnupg | |
pacman-key --init | |
# pacman-key --populate archlinux | |
pacman-key --populate archlinuxarm manjaro-arm | |
pacman -S archlinux-keyring |
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
psql -U postgres -c 'SELECT d.datname as "Name" FROM pg_catalog.pg_database d order by 1;' | \ | |
ruby -nawe 'next if /^\s*$|^\s*Name|^\s*-{3,}|строки/; puts "ALTER DATABASE \"#{$_.chomp.strip}\" REFRESH COLLATION VERSION;"' | \ | |
psql -U postgres |
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
defimpl Jason.Encoder, for: [Tuple] do | |
def encode({k, v}, opts), do: Jason.Encode.map(%{k => v}, opts) | |
def encode(tuple, opts) do | |
[k|v] = :erlang.tuple_to_list(tuple) | |
encode({k, v}, opts) | |
end | |
end |
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
gitea: | |
username: username | |
token: usertoken | |
domain: gitea.your.domain | |
repo_owner: Organisation or your username | |
gitlab: | |
domain: gitlab.com | |
token: usertoken | |
group_id: an number | |
# here go the list of repo names, which are already here |
NewerOlder