So… Lets say You have folder Dupa in Your home folder and inside that folder – chaos… ;). Files with spaces in the file and folder names. You want to sanitize them and rename them so that they all contain _ instead of space? Do this:
Run:
cd ~/Dupa/
And then run:
find . -depth -name '* *'
| while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done
This is a ONE command. Both lines.
Repeat until all the files and directories are renamed properly. I had to run this command several times before the chaos got whipped into a sensible shape.
If You want to check if there are any files or folders with spaces in the name left run:
[19:10] MrRee | wget https://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
[19:10] MrRee | tar xzf UnixBench5.1.3.tgz
[19:10] MrRee | cd UnixBench
[19:10] MrRee | make
[19:10] MrRee | ./Run -c X
[19:10] MrRee | where X is number of cores on your board.
By default xvkbd starts with the US layout. I’ve been searching for some sort of a command line switch so that I could edit the .desktop file but the only thing that I’ve found was a “clickable” layout change from the xvkbd gui after the keyboard has already started. That’s not good enough and so I’ve decided to find a way to change the layout to UK by default before keyboard before it starts. Its not pretty but it works.
After a reboot I like to run couple of commands just to find out if everything is fine. One of those commands is:
journalctl -b -l -x --no-pager -p 3
Most of the time everything is fine but sometimes…
[root@server andrzejl]# journalctl -b -l -x –no-pager -p 3
— Logs begin at Sat 2015-01-17 18:31:30 CET, end at Mon 2015-02-02 00:09:14 CET. —
Feb 01 23:51:42 server.loc kernel: microcode: no support for this CPU vendor
Feb 01 23:51:42 server.loc kernel: mce: Unable to init device /dev/mcelog (rc: -5)
Feb 01 23:51:44 server.loc kernel: longhaul: Option “enable” not set. Aborting. Feb 01 23:51:51 server.loc logger[286]: ERROR:Shorewall start failed:Firewall state not changed
Feb 01 23:51:51 server.loc systemd[1]: Failed to start Shorewall IPv4 firewall.
— Subject: Unit shorewall.service has failed
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit shorewall.service has failed.
—
— The result is failed.
The first few messages are fine. Its not a intel or amd cpu so microcode wont work and its not gonna enable the longhaul option. However the firewall not starting… Well thats something to be concerned about.
Why didn’t it start…?
systemctl status -l shorewall
● shorewall.service – Shorewall IPv4 firewall
Loaded: loaded (/usr/lib/systemd/system/shorewall.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since nie 2015-02-01 23:51:51 CET; 11min ago
Process: 178 ExecStart=/usr/bin/shorewall $OPTIONS start $STARTOPTIONS (code=exited, status=143)
Main PID: 178 (code=exited, status=143)
lut 01 23:51:51 server.loc shorewall[178]: Starting Shorewall…. lut 01 23:51:51 server.loc shorewall[178]: ERROR: Can’t determine the IP address of enp0s9: Firewall state not changed
lut 01 23:51:51 server.loc logger[286]: ERROR:Shorewall start failed:Firewall state not changed
lut 01 23:51:51 server.loc shorewall[178]: /usr/share/shorewall/lib.common: linia 113: 259 Zakończony $SHOREWALL_SHELL $script $options $@
lut 01 23:51:51 server.loc systemd[1]: shorewall.service: main process exited, code=exited, status=143/n/a
lut 01 23:51:51 server.loc systemd[1]: Failed to start Shorewall IPv4 firewall.
lut 01 23:51:52 server.loc systemd[1]: Unit shorewall.service entered failed state.
lut 01 23:51:52 server.loc systemd[1]: shorewall.service failed.
It didn’t start because it started to fast and the network was not connected at this point.
and after a lot of reading and brain-storming / testing with a friend got myself a working openvpn setup.
Here is the server config:
cat /etc/openvpn/server.andrzejl.eu.conf
dev tun
port 40404
proto tcp
cipher AES-256-CBC
server 10.8.0.0 255.255.255.0
ca server.andrzejl.eu.crt
cert client.andrzejl.eu.crt
key client.andrzejl.eu.key
dh server.andrzejl.eu.dh8192.pem
push "redirect-gateway def1 bypass-dhcp"
client-to-client
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
#push "route 192.168.0.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
script-security 3 system
client-connect /etc/openvpn/Client_Connected.sh
keepalive 10 60
user nobody
group nobody
Here is the script that is sending me e-mail each time somebody connects:
cat /etc/openvpn/Client_Connected.sh
#!/bin/bash
#Send an email when a client connects with today's time and date
NOW="$(date +"%H:%M:%S - %d-%m-%Y")"
sendmail openvpn@andrzejl.eu <<EOF
FROM: openvpn@andrzejl.eu
TO: andrzejl@andrzejl.eu
SUBJECT: $NOW: Client connected to the AndrzejL.eu OpenVPN server: $common_name
At $NOW, $common_name connected to the AndrzejL.eu OpenVPN server.
Client's IP: $trusted_ip
Client's PORT: $trusted_port
Client's MTU: $tun_mtu
.
EOF
exit 0
Here is the example of the message that script would send:
Subject:
09:14:09 - 02-02-2015: Client connected to the AndrzejL.eu OpenVPN server: andrzejl
Body:
At 09:14:09 - 02-02-2015, andrzejl connected to the AndrzejL.eu OpenVPN server.
Client's IP: 86.44.168.4
Client's PORT: 59213
Client's MTU: 1500
Here is the list of the server files with permissions:
client
dev tun
proto tcp
remote andrzejl.eu 40404
resolv-retry infinite
nobind
persist-key
persist-tun
ca server.andrzejl.eu.crt
cert client.andrzejl.eu.crt
key client.andrzejl.eu.key
remote-cert-tls server
cipher AES-256-CBC
verb 3
Here is the list of the client side files with permissions:
IF You do not use systemd based distro You can start the OpenVPN client with this set of commands:
su
modprobe tun
cd /etc/openvpn/
openvpn ./andrzejl.eu.conf
It will work fine too.
So I had the openvpn server up and running… However then I’ve ran into a little snag… I have rebooted the server and went about my business just to realize that I have no idea how to generate keys for clients. Turns out its not JUST enter the directory and run the ./build-key newclient command…
[easy-rsa]# ./build-key newclient
Please edit the vars script to reflect your configuration,
then source it with “source ./vars”.
Next, to start with a fresh PKI configuration and to delete any
previous certificates and keys, run “./clean-all”.
Finally, you can run this tool (pkitool) to build certificates/keys.
[easy-rsa]# ls keys/
cd /etc/openvpn/easy-rsa/ . ./vars ./build-key newclient
After many years of tempting and failed reasoning attempts with Rafal finally I can say that I’ve managed to convince him to do a little housekeeping on his server and since last night I can proudly say Rsanti has a blog. Not a static image gallery. Not some lighttpd / sqlite weirdness… but a proper WordPress blog, powered by a proper LAMP server. I mean Apache, MySQL, PHP, SSL… You name it. It took me a long long long time but it was all worth it. We are ALMOST there. Why almost? Well we are still working with a no-ip domain so there is no chance for a proper SSL cert but in this case self signed SSL certificate is really enough.
Sooo… Where can You find it? Here. Its still a little “bare” at the moment. Sure… The Krakow was not built in one day… But I expect many good posts from Rafal.
Piwigo overrides the displays_errors directive from the /etc/php/php.ini. If You want to disable it go to the include folder in Your Piwigo installation and edit (as root) file common.inc.php.
You will also need a mixer… and a woman that will do all the work for You… /Me runs for the hills…
A) So… Grab a bowl and add the flour and the pinch of salt.
B) Measure 500ml of milk in a measuring jug.
C) Add milk to the bowl.
D) Add sparkling water to the bowl.
E) Break the eggs.
F) I like to break each egg into a cup and check for the egg shells before I will add the egg to the bowl.
G) Add eggs to the bowl.
H) Melt the butter.
I) Add butter to the bowl.
J) Start mixing.
K) Some of the mixers are badly designed and they are not reaching to the bottom of the bowl. Make sure that You have checked bottom of the bowl for flour snot.
L) And keep mixing if necessary.
M) Mix until the entire batter has a even and smooth texture.
N) Pour a tiny itsy bitsy dot of oil on the pan.
O) Take a paper kitchen towel and wipe it off while spreading the bit of oil evenly on the pan. DON’T throw the paper away. You will need it.
P) Move part of the batter from the bowl into a measuring jug. Its easier to pour the batter onto a frying pan this way.
Q) Start pouring (very thin) layer of batter onto a hot frying pan.
R) Move the pan around to spread the batter evenly.
S) After a (very short) while start prying one side of the pancake with a spatula.
T) If everything went as planed You should be able to pick the pancake up and flip it to the other side.
U) Take the ready pancake off and pour next batch of batter on the pan.
V) Result? Very thin and equally very awesome crepes pancake AndrzejL style… +10 to the charisma in the kitchen +5 to self-respect.
W) Every once in a while re-grease the pan with a oil / kitchen paper towel.
X) Keep going…
Y) Pheeeew… The last one…
Final result? 19 1/2 awesome super thin crepes pancakes…
You can roll them with jam / chocolate / white cheese / tomato and basil sauce inside or use them as a next step of making croquets… I like to use them instead of tortillas to make chicken wraps. Makes no difference.
Enjoy.
Andrzej
P.S. Not a single woman was hurt (much) during making of this howto.