Linux – Data Science, Data Analytics and Machine Learning Consulting in Koblenz Germany https://www.rene-pickhardt.de Extract knowledge from your data and be ahead of your competition Tue, 17 Jul 2018 12:12:43 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.6 Cleaning up my network connections on ubuntu linux using the network manager nmcli https://www.rene-pickhardt.de/cleaning-up-my-network-connections-on-ubuntu-linux-using-the-network-manager-nmcli/ https://www.rene-pickhardt.de/cleaning-up-my-network-connections-on-ubuntu-linux-using-the-network-manager-nmcli/#respond Thu, 16 Apr 2015 19:03:34 +0000 http://www.rene-pickhardt.de/?p=1955 After 4 years of running a pretty stable linux on my notebook I realized that the time had come that too much software and dependencies have been on my system so I set up a clean system. By doing so I also switched to a tiling window manager called awesome (with which I am pretty happy so far). One problem (not really since it is the purpose of going to awesome) though is that everything has to be done from the command line. in particular when I join a network I have to use the network manager command line interface nmcli to set up my wireless connection or my wired connection. That is not too much of a problem but since I did a backup of all my old network connections I had quite a list of connections too look for in order to find the uuid of the network I wanted to join and enable the network with the suitable command. So I wanted to delete all the connections from hotels, airports and places that I am not visiting anymore. Obviously I could have done this by hand. But its much more fun to do it automatically and on the long term it is really faster when you are mastering your bash tools (:
So here we go with a step by step explanation of the following command that will remove all your network connections that you have never used:

$ for i in `nmcli c | grep "never" | grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; do nmcli connection delete uuid $i ; done

ok let us first see the connections that I had in my manager

$ nmcli connection

which would give me the following list

NAME UUID TYPE TIMESTAMP-REAL
Lobby 0f91bb0d-e2be-4f8a-a00e-457c8bdaf9a9 802-11-wireless never
TTH-Zentral 2d3ddca9-772f-47d9-99a1-1559640b0f25 802-11-wireless never
attwifi 6be3c5aa-fc85-415c-96e4-5583b25c23bb 802-11-wireless never
uni-koblenz 8a0d1d51-672c-4ded-ad92-18e27b8215df 802-11-wireless Do 16 Apr 2015 18:11:45 CEST
greenscafe 22dd0f8e-be2d-4402-af82-7716222add75 802-11-wireless never
WLAN-2DD138 5308ed9e-5def-430e-85f4-e1eb01426927 802-11-wireless never
Fairfield_GUEST b72080e0-c5dd-492a-b8a3-017fe7d6099c 802-11-wireless never
Hotel Sylter Hof d7c8fc6c-64e3-435f-b2c0-316c1f11ddf1 802-11-wireless never
TELENETHOTSPOT 1345bcda-26ab-4193-904c-088235d29873 802-11-wireless never
CHI_ECRC_2013 a316f6be-bb4c-4501-867b-6928f9f429ef 802-11-wireless never
AndroidAP5270 b5c5462c-072e-4e90-a3b2-def467562579 802-11-wireless never
hotel_harvey 7c6d1794-6d45-40aa-b7ac-f9a7f401d02e 802-11-wireless never
free-hotspot.com dc7351ce-ca6c-413e-ae8b-a82c2093525e 802-11-wireless never
PAT-WLAN 4662b075-9519-4f69-8ce9-b938ea8270c1 802-11-wireless never
dlink 5dab3493-cdd8-4d6c-a7a2-6def0836c2a5 802-11-wireless never
TTHKasse b9c2f9d9-aeda-454b-941b-bb1ccfc0ad9a 802-11-wireless never
BTOpenzone-B bede9d3a-9fc1-4dc2-9c75-0d2686c225f1 802-11-wireless never
MBTA_WIFI_Car0385_Box-068 17ac549c-574c-4bf4-a464-6b633f2a4ac3 802-11-wireless never
Wireless connection 1 17b18b79-411d-4d69-813d-6506f38b8ea5 802-11-wireless never
MBTA_WiFi_Car0620_Box-199 c36c572e-e469-4e86-a50f-87d6d68f4f7e 802-11-wireless never
*VIPARIS_WIFI 0593b927-644b-4604-a479-4fc652b6050d 802-11-wireless never
test 836af61a-8268-4a16-a5ab-036f3e0cf7e9 802-11-wireless So 15 Sep 2013 21:18:35 CEST
WL1A 46b6496f-6583-4306-a58f-4e4d2bdd5d50 802-11-wireless never
Hochhaus f6b80571-37d5-4bcd-b558-62084c61622b 802-11-wireless never
FreeWifi 379f9efd-b91d-433f-8ce2-209e4ed2099b 802-11-wireless never
NETCONNECT-6202 2f84b475-a852-49ac-a236-61b3f0bc9548 802-11-wireless never
stolteraa d789f49e-2643-4894-96a8-4e10ea3cbb69 802-11-wireless never
ALICE-WLAN28 17e4838f-bbaf-470c-bf24-9de948b42b00 802-11-wireless never
NAS QNAP ef6a08df-1c7c-48ba-b476-f3ff3b1e2669 802-3-ethernet Mi 15 Apr 2015 11:03:51 CEST
WLAN-8CA902 3046307e-69a3-4c99-89fb-b79f7f9ee24b 802-11-wireless Mi 01 Apr 2015 11:42:27 CEST
MfN-Guest 25d3765f-dcca-4f40-872a-8ffcfe307f25 802-11-wireless never
FRITZ!Box Fon WLAN 7360 7c428f50-078d-442a-9ba7-268853c888f0 802-11-wireless Mo 11 Feb 2013 23:39:08 CET
Arcor-362007-L 87a2d11c-3a3d-4b5e-a1b0-cc5b38916035 802-11-wireless Di 14 Apr 2015 17:42:33 CEST
Telekom_ICE 8763adcc-f27b-441f-9184-594128871351 802-11-wireless So 29 Mär 2015 19:56:35 CEST
IBMVISITOR 48227bb6-63e8-4a58-8b8f-1929f76d8ef2 802-11-wireless never
OWL 13ff2ed5-8ecf-4d67-b039-a3bc4cce56d9 802-11-wireless never
Parkhotel Kraehennest e763a256-4a2d-4813-b354-57ad8f642e2a 802-11-wireless never
EasyBox-AD3112 e4f342ae-d20b-4abc-9fe2-52b208d6b61b 802-11-wireless never
BTOpenzone 860cf4c0-45eb-4a57-a01e-cfd54933387f 802-11-wireless never
southshore 274cfaa8-2c08-4abc-bef3-3fd2608060b8 802-11-wireless never
annanet 06b3b3bc-a264-4d05-a848-3b5d6df9eed0 802-11-wireless never
shared 806c9806-fadc-472f-8460-318babbd38ea 802-3-ethernet Fr 10 Apr 2015 09:39:50 CEST
vidiu 3abf0848-b09c-457e-9c7a-958728f2c59f 802-11-wireless never
wlan 1 ad9e4a07-b66f-4f3f-8f6d-4f5a81b2ed54 802-11-wireless never
CITYHOTEL dec05243-06b6-4477-8813-0491b436f993 802-11-wireless never
eduroam f844713b-a726-4b5b-98a5-3b35411c4cf5 802-11-wireless never
Starlight-HotSpot 6842159f-94e9-4f5d-8a76-93b1f4c32912 802-11-wireless never
Dr_l)P35_21_22#342C5C e307b6e8-598b-4bd1-b47f-dc8a34ff12e0 802-11-wireless never
iPhone 5 9070ee1c-8ac1-4458-a590-cf241685b929 802-11-wireless never
Lummerland 7d2d4d89-9eb7-45c0-a963-a8a240e33100 802-11-wireless Mo 10 Feb 2014 22:35:03 CET
AndroidAP4089 ec201acc-9e6f-4c7b-9da8-6ed4539dde6c 802-11-wireless never
heartofgold 437e2b7d-5b76-4e3e-a101-698776293ede 802-11-wireless never
09FX09039648 e2cc4508-e18e-4c0c-a694-633ace5d095a 802-11-wireless never
WIRELESS_BEN_GURION_AIRPORT 8ff2846d-9e84-4175-8c4d-968e226e7a43 802-11-wireless never
Telekom 60aded97-f697-48c6-8070-91e1b786df82 802-11-wireless Mi 15 Apr 2015 00:14:14 CEST
Marriott_CONF a4ec2c22-8a31-46bb-a146-a02d8f7b2582 802-11-wireless never
TTH-Seminar4+5 23422256-0a4b-45b5-8394-43c92592564d 802-11-wireless never
FRITZ!Box 7330 SL a431f83e-6a73-4cf1-94ee-4409c19dfdb9 802-11-wireless Do 13 Feb 2014 18:45:48 CET
mycloud f3fcf1ae-eebb-4e37-a700-96035d0aea59 802-11-wireless never
ArcorWirelessLAN 428769c9-3dfc-43f0-a2dc-29f3c4ecb0fb 802-11-wireless never
TP-LINK_PocketAP_7329E2 a17a19b4-251e-41d7-a82e-1add52ec1317 802-11-wireless never
TTH-Taunus fbb24cae-c2aa-4057-be67-095b80604f5e 802-11-wireless never
BWI-WiFi 58e749f6-58e9-44fe-8528-6a1e3bacc88f 802-11-wireless never
uni vpn b28d76f8-57d2-4548-8959-9c47e189221e vpn never
Miri 🙂 74147f40-07c4-4e91-8a43-8c69bc733479 802-11-wireless never
wiew7 7193e045-9570-4d16-b4b6-d676fc19d05a 802-11-wireless never
ZurichAirport 0fe8cde1-de8b-48f9-9ca0-52ac129e9876 802-11-wireless never
mercure f3fbf40d-7c2b-4e6d-b5db-fce6888bb719 802-11-wireless never
HITRON-A600 501ac6d9-6912-46a1-9681-4a73e1009fe0 802-11-wireless never
HTC Portable Hotspot 61EF 3675cadc-251a-487c-8c4d-cf3747117f13 802-11-wireless never
FRITZ!Box 7312 a7d9b99d-63bc-4caa-b82c-1da9fec95cea 802-11-wireless never
o2-WLAN38 76a67dd7-3d50-4388-ba9f-07f52a328eca 802-11-wireless never
ALICE-WLAN36 e55d0ccd-7941-4da0-8ac8-99ed22adda49 802-11-wireless never
WEBPORTAL e2ce59eb-fa7d-4ece-88b7-bd0585a8d589 802-11-wireless never
FOSDEM 0cc3584b-1a5e-41fd-944e-df85f0a2d418 802-11-wireless never
BRITZ!Fox Fon WLAN 7360 SL fc70206c-04c8-4ae6-a0fd-7f769addf0b6 802-11-wireless never
Hotel Amsee3 f4ff9826-22d2-4f9b-91d9-8c63dc0f9bd4 802-11-wireless So 29 Mär 2015 11:56:21 CEST
ibis a348ed30-2fcf-4068-ba1c-176cdd9e7b10 802-11-wireless never
O2 Wifi 8935490d-313f-4fd0-b1fd-c78ab138af51 802-11-wireless never
FRITZ!Box Fon WLAN 7270 50d62587-5a48-4635-b30f-fbb1ded20455 802-11-wireless Di 30 Dez 2014 12:23:23 CET
Ambassador-Opera fdefea8c-d218-4632-bb07-b67ddb63f778 802-11-wireless never
HOTEL BB 05d9792c-6f9e-48a6-9c0c-6c03a9708954 802-11-wireless never
MBTA_WiFi_Car0353_Box-104 24a1527c-3083-44f3-8812-cacafb88cf7a 802-11-wireless never
theairline 54770eb9-78f2-4a3b-86cf-0e594a55c9f9 802-11-wireless never
republicansareontheirown 074ca340-643c-411e-95eb-d6e78f887fcf 802-11-wireless never
VPN/WEB 4a5f132b-81c2-49ba-8934-0257f98e5a54 802-11-wireless never
WLAN-6A1EA7 d2e80ec0-9bd3-4801-bada-65a695f7dc92 802-11-wireless never
Mahler 1d59c9a1-090c-4333-b2af-4154d5edd9c2 802-11-wireless never
guest-access c0ff03ac-a195-46a7-a507-5c1cf5c7f668 802-11-wireless never
Schlummerland 3d029511-2627-458a-a06b-e2c8e86d26b4 802-11-wireless never
MSDSL2 f2fbd0b7-26f6-4939-aece-c2c9d3621e40 802-11-wireless Do 16 Apr 2015 20:28:22 CEST
Urania 846e76bc-b96f-40aa-a30f-b6d2f84fd7f0 802-11-wireless never
CJDDSAWLN 55158cdb-07cc-4c02-8f44-a19ec2aeca06 802-11-wireless never
AndroidAP 375e398a-1b2e-4d2e-b4a5-4c05c904b109 802-11-wireless Fr 02 Jan 2015 16:29:17 CET
gesis-guest b9a00edd-9e28-4549-8f13-2634577c1276 802-11-wireless never
guests@WMDE 9aeccb7b-e629-4f0a-ab81-5300c7c433c0 802-11-wireless never
Wired connection 1 30ffcf0e-5181-41b0-b7d4-402de875889f 802-3-ethernet Mo 04 Mär 2013 15:10:44 CET
wlan a2f073a8-f0b0-4f58-a79a-2f22131016b1 802-11-wireless never
Wired connection 2 700ebb58-f049-4ec7-bac6-cd5801a975e2 802-3-ethernet Do 16 Apr 2015 18:11:44 CEST
Wired connection 3 bf70a943-9510-4883-ba64-a4bede826120 802-3-ethernet Do 16 Apr 2015 09:26:08 CEST
30 Min. Free Wi-Fi - Vodafone f5cd9efa-d735-41d5-a90f-ba83357f2e40 802-11-wireless never
WIKIMEDIA a40d0c35-8232-42db-b5a2-2118d69d6c41 802-11-wireless never
loganwifi 41e42d9c-efe9-45c5-9f8e-a2f5f441dd73 802-11-wireless never
WL3D efe99726-557a-4595-90e8-9c0fc3ee0c20 802-11-wireless never
m3connect 6ce7f634-5c44-4818-a055-cb32dca20738 802-11-wireless never
MIRI-PC_Network d1243377-9aed-4abf-8207-90b47840a48f 802-11-wireless never
innflux bd5be404-6a8b-402a-8a6f-856eaa054664 802-11-wireless never
LRTA24open2 dc95a098-107f-46c9-8d36-23cf575a319f 802-11-wireless never
LRTA24open3 5166cb9a-20ff-4d5c-b224-88f0b2276398 802-11-wireless never
Boingo Hotspot 954559e9-5f8c-4f9b-b2bc-36ff23f18d4a 802-11-wireless never

the interesting part is the fourth column which is luckily saying never if a connection was never used. so that is an easy grep:

nmcli c | grep "never"

from this list I need the second colum in particular the uuids. I could have done this with some awk magic but I decided greping for uuids should be easier so lets pipe the output to another grep:

nmcli c | grep "never" | grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"

as we can see the regular expression is really straight forward. there are two arguments given first of all -o that is to only output what was matched and not the complete lines and the helps for greping hyphens. The cool thing is with having the web and search engines you don’t even have to build this regular expression on your own. Click on my search query for an blog article explaining the background: grep regular expression uuid
Next we have to iterate over the result and use it in the nwcli connection delete command. From the docu of nmcli we know

Usage: nmcli connection { COMMAND | help }
COMMAND := { list | status | up | down | delete }
list [id | uuid ]
status [id | uuid | path ]
up id | uuid [iface ] [ap ] [--nowait] [--timeout ]
down id | uuid
delete id | uuid

so the code should look something like:

nmcli connection delete uuid 954559e9-5f8c-4f9b-b2bc-36ff23f18d4a

only that 954559e9-5f8c-4f9b-b2bc-36ff23f18d4a will be replaced by all the uuids from my grep statements.
so let’s put this big grep in a loop and just echo everything to see if it is working. just use backticks around the grep and make a loop:

$ for i in `nmcli c | grep "never" | grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; do echo $i ; done
0f91bb0d-e2be-4f8a-a00e-457c8bdaf9a9
2d3ddca9-772f-47d9-99a1-1559640b0f25
6be3c5aa-fc85-415c-96e4-5583b25c23bb
22dd0f8e-be2d-4402-af82-7716222add75
5308ed9e-5def-430e-85f4-e1eb01426927
b72080e0-c5dd-492a-b8a3-017fe7d6099c
d7c8fc6c-64e3-435f-b2c0-316c1f11ddf1
1345bcda-26ab-4193-904c-088235d29873
a316f6be-bb4c-4501-867b-6928f9f429ef
b5c5462c-072e-4e90-a3b2-def467562579
7c6d1794-6d45-40aa-b7ac-f9a7f401d02e
dc7351ce-ca6c-413e-ae8b-a82c2093525e
4662b075-9519-4f69-8ce9-b938ea8270c1
5dab3493-cdd8-4d6c-a7a2-6def0836c2a5
b9c2f9d9-aeda-454b-941b-bb1ccfc0ad9a
bede9d3a-9fc1-4dc2-9c75-0d2686c225f1
17ac549c-574c-4bf4-a464-6b633f2a4ac3
17b18b79-411d-4d69-813d-6506f38b8ea5
c36c572e-e469-4e86-a50f-87d6d68f4f7e
0593b927-644b-4604-a479-4fc652b6050d
46b6496f-6583-4306-a58f-4e4d2bdd5d50
f6b80571-37d5-4bcd-b558-62084c61622b
379f9efd-b91d-433f-8ce2-209e4ed2099b
2f84b475-a852-49ac-a236-61b3f0bc9548
d789f49e-2643-4894-96a8-4e10ea3cbb69
17e4838f-bbaf-470c-bf24-9de948b42b00
25d3765f-dcca-4f40-872a-8ffcfe307f25
48227bb6-63e8-4a58-8b8f-1929f76d8ef2
13ff2ed5-8ecf-4d67-b039-a3bc4cce56d9
e763a256-4a2d-4813-b354-57ad8f642e2a
e4f342ae-d20b-4abc-9fe2-52b208d6b61b
860cf4c0-45eb-4a57-a01e-cfd54933387f
274cfaa8-2c08-4abc-bef3-3fd2608060b8
06b3b3bc-a264-4d05-a848-3b5d6df9eed0
3abf0848-b09c-457e-9c7a-958728f2c59f
ad9e4a07-b66f-4f3f-8f6d-4f5a81b2ed54
dec05243-06b6-4477-8813-0491b436f993
f844713b-a726-4b5b-98a5-3b35411c4cf5
6842159f-94e9-4f5d-8a76-93b1f4c32912
e307b6e8-598b-4bd1-b47f-dc8a34ff12e0
9070ee1c-8ac1-4458-a590-cf241685b929
ec201acc-9e6f-4c7b-9da8-6ed4539dde6c
437e2b7d-5b76-4e3e-a101-698776293ede
e2cc4508-e18e-4c0c-a694-633ace5d095a
8ff2846d-9e84-4175-8c4d-968e226e7a43
a4ec2c22-8a31-46bb-a146-a02d8f7b2582
23422256-0a4b-45b5-8394-43c92592564d
f3fcf1ae-eebb-4e37-a700-96035d0aea59
428769c9-3dfc-43f0-a2dc-29f3c4ecb0fb
a17a19b4-251e-41d7-a82e-1add52ec1317
fbb24cae-c2aa-4057-be67-095b80604f5e
58e749f6-58e9-44fe-8528-6a1e3bacc88f
b28d76f8-57d2-4548-8959-9c47e189221e
74147f40-07c4-4e91-8a43-8c69bc733479
7193e045-9570-4d16-b4b6-d676fc19d05a
0fe8cde1-de8b-48f9-9ca0-52ac129e9876
f3fbf40d-7c2b-4e6d-b5db-fce6888bb719
501ac6d9-6912-46a1-9681-4a73e1009fe0
3675cadc-251a-487c-8c4d-cf3747117f13
a7d9b99d-63bc-4caa-b82c-1da9fec95cea
76a67dd7-3d50-4388-ba9f-07f52a328eca
e55d0ccd-7941-4da0-8ac8-99ed22adda49
e2ce59eb-fa7d-4ece-88b7-bd0585a8d589
0cc3584b-1a5e-41fd-944e-df85f0a2d418
fc70206c-04c8-4ae6-a0fd-7f769addf0b6
a348ed30-2fcf-4068-ba1c-176cdd9e7b10
8935490d-313f-4fd0-b1fd-c78ab138af51
fdefea8c-d218-4632-bb07-b67ddb63f778
05d9792c-6f9e-48a6-9c0c-6c03a9708954
24a1527c-3083-44f3-8812-cacafb88cf7a
54770eb9-78f2-4a3b-86cf-0e594a55c9f9
074ca340-643c-411e-95eb-d6e78f887fcf
4a5f132b-81c2-49ba-8934-0257f98e5a54
d2e80ec0-9bd3-4801-bada-65a695f7dc92
1d59c9a1-090c-4333-b2af-4154d5edd9c2
c0ff03ac-a195-46a7-a507-5c1cf5c7f668
3d029511-2627-458a-a06b-e2c8e86d26b4
846e76bc-b96f-40aa-a30f-b6d2f84fd7f0
55158cdb-07cc-4c02-8f44-a19ec2aeca06
b9a00edd-9e28-4549-8f13-2634577c1276
9aeccb7b-e629-4f0a-ab81-5300c7c433c0
a2f073a8-f0b0-4f58-a79a-2f22131016b1
f5cd9efa-d735-41d5-a90f-ba83357f2e40
a40d0c35-8232-42db-b5a2-2118d69d6c41
41e42d9c-efe9-45c5-9f8e-a2f5f441dd73
efe99726-557a-4595-90e8-9c0fc3ee0c20
6ce7f634-5c44-4818-a055-cb32dca20738
d1243377-9aed-4abf-8207-90b47840a48f
bd5be404-6a8b-402a-8a6f-856eaa054664
dc95a098-107f-46c9-8d36-23cf575a319f
5166cb9a-20ff-4d5c-b224-88f0b2276398
954559e9-5f8c-4f9b-b2bc-36ff23f18d4a

that looks great so replace the echo with the real command:

nmcli connection delete uuid $i

this will lead to the follwing final command which is identical to the one on the top of the article but just with some line breaks for better readability.

$ for i in `nmcli c | \
grep "never" | \
grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; \
do nmcli connection delete uuid $i ; \
done

Now I only have a few connections in my network manager so that I can easily switch connections from the command line depending on where I am:

$ nmcli c
NAME UUID TYPE TIMESTAMP-REAL
AndroidAP 375e398a-1b2e-4d2e-b4a5-4c05c904b109 802-11-wireless Fr 02 Jan 2015 16:29:17 CET
FRITZ!Box 7330 SL a431f83e-6a73-4cf1-94ee-4409c19dfdb9 802-11-wireless Do 13 Feb 2014 18:45:48 CET
NAS QNAP ef6a08df-1c7c-48ba-b476-f3ff3b1e2669 802-3-ethernet Mi 15 Apr 2015 11:03:51 CEST
MSDSL2 f2fbd0b7-26f6-4939-aece-c2c9d3621e40 802-11-wireless Do 16 Apr 2015 20:28:22 CEST
shared 806c9806-fadc-472f-8460-318babbd38ea 802-3-ethernet Fr 10 Apr 2015 09:39:50 CEST
Hotel Amsee3 f4ff9826-22d2-4f9b-91d9-8c63dc0f9bd4 802-11-wireless So 29 Mär 2015 11:56:21 CEST
Lummerland 7d2d4d89-9eb7-45c0-a963-a8a240e33100 802-11-wireless Mo 10 Feb 2014 22:35:03 CET
FRITZ!Box Fon WLAN 7270 50d62587-5a48-4635-b30f-fbb1ded20455 802-11-wireless Di 30 Dez 2014 12:23:23 CET
Arcor-362007-L 87a2d11c-3a3d-4b5e-a1b0-cc5b38916035 802-11-wireless Di 14 Apr 2015 17:42:33 CEST
Telekom 60aded97-f697-48c6-8070-91e1b786df82 802-11-wireless Mi 15 Apr 2015 00:14:14 CEST
Wired connection 3 bf70a943-9510-4883-ba64-a4bede826120 802-3-ethernet Do 16 Apr 2015 09:26:08 CEST
FRITZ!Box Fon WLAN 7360 7c428f50-078d-442a-9ba7-268853c888f0 802-11-wireless Mo 11 Feb 2013 23:39:08 CET
test 836af61a-8268-4a16-a5ab-036f3e0cf7e9 802-11-wireless So 15 Sep 2013 21:18:35 CEST
Wired connection 1 30ffcf0e-5181-41b0-b7d4-402de875889f 802-3-ethernet Mo 04 Mär 2013 15:10:44 CET
Telekom_ICE 8763adcc-f27b-441f-9184-594128871351 802-11-wireless So 29 Mär 2015 19:56:35 CEST
Wired connection 2 700ebb58-f049-4ec7-bac6-cd5801a975e2 802-3-ethernet Do 16 Apr 2015 18:11:44 CEST
WLAN-8CA902 3046307e-69a3-4c99-89fb-b79f7f9ee24b 802-11-wireless Mi 01 Apr 2015 11:42:27 CEST
uni-koblenz 8a0d1d51-672c-4ded-ad92-18e27b8215df 802-11-wireless Do 16 Apr 2015 18:11:45 CEST

]]>
https://www.rene-pickhardt.de/cleaning-up-my-network-connections-on-ubuntu-linux-using-the-network-manager-nmcli/feed/ 0
Attending Mozilla Devroom at FOSDEM: Hacking Gecko by Bobby Holley https://www.rene-pickhardt.de/attending-mozilla-devroom-at-fosdem-hacking-gecko-by-bobby-holley/ https://www.rene-pickhardt.de/attending-mozilla-devroom-at-fosdem-hacking-gecko-by-bobby-holley/#respond Sat, 04 Feb 2012 14:04:24 +0000 http://www.rene-pickhardt.de/?p=1072 Since I went to Brussesl to attend the Free Open Source Developer European Meeting and give a talk about graphity I had also some time to attend some interesting talks. Since I will teach a class in summer for students about creating a basic webserver and webbrowser I decided to listen to some talks of the mozilla devrooom.
I first attended a very refreshing and fun talk given by Bobby Holley a platform engineer at mozilla about hacking the Rendering Engine Gecko. I think I realized some things that are not only of interest for hacking gecko but also for hacking metalcon or some other software!
you can find his slides on http://people.mozilla.com/~bholley/hacking-gecko-fosdem2012/hacking-gecko.html (when you go there just use the arrow keys to navigate!)
Some messages I found particular interesting together with my thoughts and comments:

Making Mozilla is great!

So this is actually why Mozilla thinks making Mozilla is great and what their motivation is. They think firefox enables them to change the way the web is developed. If they don’t like something they won’t implement it. So you clearly see one asset of Firefox is being in the gate keeper position. And being there is valuable in its own. That is probably one of the reasons why Google put so much effort on chrome and android. Both products go very deep and make google a gatekeeper giving them tons of power to steer developments in the “right” direction. 

Look at the feature!

Bobby pointed out that if you want to contribute to Mozilla are Gecko you should not even consider to follow a top down approach. He said that it is impossible to understand 7 mio. lines of (fast changing) code. He rather suggests to look at the specific feature you want to develope and  look at the documentation. You should play around and get it running. In my own experience that is on of the things that makes the difference betweed some coder and an amazing hacker. If you are really able to hack your things in an entire system without overview of the entire thing then your “in business”

Tests are awesome!

Ok that was the most interesting take away. Bobby said that tests are important not only so you can see that your code works properly and that you can check that your code doesn’t interfere with others. But tests are also great so if people change their parts they can check your feature will still work with their. He said your tools won’t continue working for longer than a couple weeks unless you provide tests so others see their plugins don’t destroy your work… Metalcon was only 40’000 lines of code and pretty manageable but we already saw weired things getting messed up once we checked in some code at some other point. To quote Bobby: 

If you check in some new lines you can smoke test them but if you check them in and 200 test lamps go green it feels good. More importantly. A huge community will make new stuff so if you didn’t write a test within a month your new feature might not work…

]]>
https://www.rene-pickhardt.de/attending-mozilla-devroom-at-fosdem-hacking-gecko-by-bobby-holley/feed/ 0
how to move wordpress directory: Problems with upload_path wp-content/uploads https://www.rene-pickhardt.de/how-to-move-wordpress-directory-problems-with-upload_path-wp-contentuploads/ https://www.rene-pickhardt.de/how-to-move-wordpress-directory-problems-with-upload_path-wp-contentuploads/#comments Thu, 24 Mar 2011 13:30:36 +0000 http://www.rene-pickhardt.de/?p=329 Recently I was forced to move a wordpress site to a different webserver. By moving to a new server due to different hosting policies I also had to change the physical directory in which the wordpress files were stored. Before it was something like /var/www/wordpress afterwards it became /home/domainname/www/ . So after moving the data base and moving the wordpress installation and changing the DNS entry for the domain and some minor downtime in the middle of the night I figured out that some plugins on the new server would not work.
Especially those that needed to access uploaded files did have problems.

What happened?

After some debugging I did a fulltext search on the database for %/var/www/wordpress/ and i found one entry in wp_options table having: option_name =”upload_path” option_value=”/var/www/wordpress/wp-content/uploads” so obviously on installation time wordpress is saving the path of the upload folder in its option table to the data base. Still not sure weather this is a bug or a feature but I don’t have time to further investigate. Anyone some ideas?

]]>
https://www.rene-pickhardt.de/how-to-move-wordpress-directory-problems-with-upload_path-wp-contentuploads/feed/ 4
How to download Wikipedia https://www.rene-pickhardt.de/how-to-download-wikipedia/ https://www.rene-pickhardt.de/how-to-download-wikipedia/#comments Wed, 16 Feb 2011 18:58:00 +0000 http://www.rene-pickhardt.de/?p=249 Wikipedia is an amazing data set to do all different kinds of research which will go far beyond text mining. The best thing about Wikipedia is that it is licensed under creative common license. So you are allowed to download Wikipedia and use it in any way you want. The articles have almost no spelling mistakes and a great structure with meaningful headings and subheadings. This makes Wikipedia to a frequently used data set in computer science. No surprise that I decided to download and examine Wikipedia. I first wanted to gain experience in natural language processing. Furthermore I wanted to test some graph mining algorithms and I wanted to obtain some statistics about my mother tong German.
Even though it is very well documented how to download this great data set there are some tiny obstacles which made me struggle once in a while. For the experienced data miner these challenges will probably be easy to master but I still think it is worth wile blogging about them.
Don’t crawl Wikipedia please!
After reading Toby Segaran’s book “Programming collective intelligence” about 2 years ago I wanted to build my first simple web crawler and download Wikipedia by crawling Wikipedia. After installing python and the library beautiful soup which is recommended by Toby I realized that my script could not download Wikipedia pages. I also didn’t get any meaningful error message which I could have typed in Google. After a moment of thinking I realized that Wikipedia might not be happy with to many unwanted crawler since crappy crawlers can produce a lot of load on the web server. So I had a quick look at http://de.wikipedia.org/robots.txt and quickly realized that Wikipedia is not to happy with strangers crawling and downloading it.
I once have heard that database dumps of Wikipedia are available for download. So why not downloading a database dump, installing a web server on my notebook and crawl my local version of Wikipedia? This should be much faster anyway.
Before going over to the step of downloading a database dump I tried to change my script in order to send “better” http-headers to Wikipedia while requesting pages to download. That was not because I wanted to go on crawling Wikipedia anyway I just wanted to see weather I would be able to trick them. Even though I set my user agent to mozilla I was not able to download one single Wikipedia page using my python script.

Wikipedia is huge!

Even though I went for the German Wikipadia which doesn’t even have half the size of the English one I ran into serious trouble due to the huge amount of data. As we know data mining usually is not complex because the algorithms are so difficult but rather because the amount of data is so huge. I would consider Wikipedia to be a relatively small data set but as stated above sufficient big to cause problems.
After downloading the correct data base dump which was about 2 GB in size I had to unzip it. Amazingly no zip program was able to unzip the 7.9 GB huge XML file that contained all current Wikipedia articles. I realized that changing to my Linux operating system might have been a better Idea. So I put the file on my external hard drive and reboot my system. Well Linux didn’t work ether. After exactly 4 GB the unzipping process would stop. Even though I am aware of the fact that 2^32 = 4 GB I was confused an asked Yann for advice and he immediately asked weather I would use Windows or Linux. I told him that I just switched to Linux but then it also came to my mind. My external hard drive has Fat32 as a file system which cannot handle files bigger than 4 GB.
After copying the zipped database dump to my Linux file system the unzipping problem was successfully solved. I installed a media wiki on my local system in order to have all the necessary data base tables. Mediawiki also comes with an import script. This script is php based and incredibly slow. About two articles per second will be parsed and imported to the data base. 1 million articles would therefor need about 138 hours or more than five and a half days. For a small data set and experiment this is unacceptable. Fortunately Wikipedia also provides a java file called mwdumper which can process about 70 articles per second. The first time I was running this java program it crashed after 150’000 articles. I am still not to sure what reason caused the crash but I decided to tweak the mysql settings in /etc/mysql/my.cnf a little bit. So after assigning more memory to mysql I started the script for a second time realizing that it couldn’t continue to import the dump. After truncating all tables I restarted the whole import process again. Right now it is still ongoing but it already has included 1’384’000 articles and my system still seems stable.

Summery: How to download Wikipedia in a nutshell?

  1. Install some Linux on your computer. I recommend Ubuntu
  2. Use the package manager to install mysql, apache and PHP
  3. Install and set up mediawiki (this can also be done via package manger)
  4. Read http://en.wikipedia.org/wiki/Wikipedia:Database_download in opposite to the German version file size issues are discussed within the article
  5. Find the Wikipedia dump that you want to download on the above page
  6. Use the Java Programm MWDumper and read the instructions.
  7. Install Java if not already done (can be done with package manager)
  8. Donate some money to the Wikimedia foundation or at least contribute to Wikipedia by correcting some articles.

So obviously I haven’t even started with the real interesting research of German Wikipedia. But I thought that it might already be interesting to share the experience I already had with you. A nice but not surprising effect is by the way that the local version of Wikipedia is amazingly fast. After I have crawled and indexed Wikipedia and transferred the data to some format that I can better use I might write another article and maybe I will even publish a dump of my data structures.

]]>
https://www.rene-pickhardt.de/how-to-download-wikipedia/feed/ 5