Perl 6 - the future is here, just unevenly distributed

IRC log for #crimsonfu, 2017-10-15

crimsonfu - sysadmins who code

| Channels | #crimsonfu index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:55 ilbot3 joined #crimsonfu
01:55 Topic for #crimsonfu is now http://crimsonfu.github.com - ConfiguRatIon Management of Systems Or Network kung FU | logs at http://irclog.perlgeek.de/crimsonfu/today
15:17 melodie joined #crimsonfu
15:17 melodie hi!
15:17 melodie I'd like some help with a command line which I want to use in a script
15:18 melodie I'd like to replace a command line using "gksu xterm" with one using "gksu x-terminal-emulator"
15:18 melodie this one works : gksu "xterm -maximized -e 'apt-get update && sleep 6 && apt-get dist-upgrade -q -y && apt-get autoremove -q -y'
15:19 melodie I'd like to make it work with something such as " gksu x-terminal-emulator ... " which is a symlink to any console a user has (in deb distributions). I can't find how to tweak the command like to make it work
15:56 pdurbin melodie: why do you want to use "gksu" rather than ordinary "su"? You want a graphical window to be visible?
16:05 melodie hi pdurbin
16:05 melodie yes, that's right
16:06 pdurbin The maximized version works?
16:06 melodie I finally think there is no viable alternative console as it's a symlink so the result will always depend on the features which come with the virtual console
16:06 melodie yes it does
16:06 pdurbin Good. Ship it. :)
16:10 pdurbin melodie: is the project on github?
16:11 melodie no it's a simple command line
16:11 melodie gksu "xterm -maximized -e 'apt-get update && sleep 6 && apt-get dist-upgrade -q -y && apt-get autoremove -q -y'
16:11 melodie in a shell script
16:11 melodie this does not deserve being on github imo
16:12 pdurbin melodie: so this is just a script for your own personal use?
16:22 melodie it's a script I want to port to the next Sushi Openbox edition (the small and lighter version)
16:23 pdurbin Is Sushi Openbox on GitHub?
16:25 melodie no it's not
16:25 pdurbin GitLab?
16:25 melodie https://gitlab.com/groups/bento-openbox
16:27 pdurbin Would the script go in the "openbox-control-center"?
16:27 melodie not at this point
16:28 pdurbin Ok. Which repo would it go in?
16:28 melodie the openbox control center is still a project with no dev to take care of it
16:28 melodie it will go directly into the /usr/local/bin directory
16:28 melodie http://downloads.linuxvillage.org/
16:28 melodie later it will be in a new branch on gitlab
16:29 melodie which will contain all the tree directory specific to Sushi
16:29 pdurbin melodie: ok. I assume you mean a new repo on gitlab (and a new branch in the new repo).
16:29 melodie I don't work from the ground to the top, but from the top to the ground (which we will eventually reach one day when a few more devs lend a hand )
16:30 melodie pdurbin perhaps, I'm not keen enough with git to tell
16:31 pdurbin I would start by creating the repo and putting your working script in it with a comment that says "FIXME: Run this in a window that is not maximized."
16:31 melodie the thing is I want to provide a new sushi next, which will stay small with almost no end user applications, but easier to start with than it is now
16:31 melodie this is not a fix me
16:31 melodie if I don't want it maximized I just remove the option that makes it maximized
16:32 melodie the point would have been to make it available without the need to use xterm which is a bit ugly, but well that's what it is.
16:32 melodie it's ugly but it works fine and stays light
16:32 pdurbin See "rough consensus and running code" (emphasis on running/working code) at https://en.wikipedia.org/wiki/Rough_consensus
16:34 melodie I'm going to try eterm
16:34 pdurbin ok
16:38 melodie ggg the command name is "Eterm" :-((
16:39 pdurbin melodie: you could post your working version on http://www.commandlinefu.com and ask for help
16:40 melodie thanks, I'l consider it eventually
16:47 melodie pdurbin perhaps "terminator" will be the one
16:47 melodie I'm installing python-keybinder now as there was an error message stating it was missing
16:48 melodie I retry «  gksu "terminator -e '/usr/bin/apt-get update && sleep 6 && /usr/bin/apt-get dist-upgrade && /usr/bin∕apt-get autoremove'"  »
16:48 melodie hummm
16:48 pdurbin melodie: cool. I brought my daughter and a friend to a Girl Hackathon yesterday, by the way: https://twitter.com/philipdurbin/status/919268956367740928 . You're a good hacker. :)
16:48 melodie "luginRegistry::load_plugins: Importing plugin __init__.py failed: 'module' object has no attribute 'AVAILABLE'
16:48 melodie '/root/.config/terminator/config')"
16:48 melodie am I?
16:49 melodie nice hackaton! great!
16:50 pdurbin melodie: you're a hacker. You don't give up: https://xkcd.com/627/ :)
16:54 melodie pdurbin LOL ! That's sooo true! XD
16:54 melodie I'll print it for my future shop
16:54 melodie :D
16:54 pdurbin :)
17:00 melodie my say for the shop will be "your local expert" !
17:03 melodie pdurbin you could perhaps help me with something else
17:04 melodie when you configure a cron task, what is the meaning of * in the line, and what is the meaning of a 0 ?
17:04 melodie I have not been able to distinguish the difference while reading tutorials presenting examples
17:05 pdurbin melodie: `man 5 crontab` says, "A field may be an asterisk (*), which always stands for ``first-last''."
17:06 pdurbin First through last for "minute 0-59" means every minute.
17:06 pdurbin First through last for "hour 0-23" means every hour.
17:07 pdurbin First through last for "day of week 0-7" means every day.
17:07 pdurbin And so on.
17:07 melodie I don't get it
17:07 melodie I want to start "update-system.sh" once a day, but not necessarily at the start of the session
17:08 melodie and perhaps not with a gui btw
17:09 pdurbin You can use "@daily" instead of "0 0 * * *" which means "every day at midnight". This is also in `man 5 crontab`.
17:10 pdurbin https://manpages.debian.org/jessie/cron/crontab.5.en.html
17:10 melodie wait wait
17:10 melodie I get it
17:10 melodie a 0 is for 'not at all'
17:11 melodie I bet I would need a full course
17:11 melodie with practical examples (not online, with my lug)
17:13 pdurbin No, depending on which field you've used a 0 in, the 0 can mean Sunday or the midnight hour or the top of the hour. It doesn't mean "not at all". It's confusing. If you want it to run once a day, just use @daily.
17:15 melodie ok
17:15 melodie how to use "@daily" ?
17:15 pdurbin melodie: there are a couple "@daily" examples at https://github.com/pdurbin/greptilian-vagrant/blob/master/files/var/spool/cron/crontabs/pdurbin
17:16 melodie I look!
17:16 melodie where do you create the "@daily" then?
17:16 melodie you have to make it a symlink?
17:17 pdurbin No. Use `crontab -l` to list your crontab file. Then use `crontab -e` to edit it.
17:17 melodie oh ok!
17:19 melodie done
17:19 melodie now I'd like to improve it, by removing the use of gui tools : I hope it can be done that way
17:20 melodie what would be the final of the script if the internet connection isn't up?
17:20 pdurbin melodie: your goal is to run `apt-get-update and apt-get dist-upgrade` automatically once a day, right? There might be a config option for that.
17:22 melodie here is my dilemna: http://pastebin.fr/51960
17:23 melodie pdurbin do you mean in apt?
17:23 pdurbin yeah
17:23 melodie not just run it, but prior make sure a connection is up
17:23 melodie to avoid triggering stupid errors that fill the /var/crash directory
17:24 melodie leading to more trouble and crashes because this stupid directory needs to be cleansed manually
17:24 melodie what is a "give up" command? Is it "quit" ?
17:25 melodie "if ping responds do the command line, else quit" ?
17:25 melodie (see my pastebin please)
17:26 pdurbin "exit"
17:26 pdurbin or "exit 1" (anything non-zero)
17:27 pdurbin Just "exit" means "exit 0" which means no errors.
17:42 melodie ok thanks!
17:42 melodie this gui version works!:
17:42 melodie gksu "terminator -m -e '/usr/bin/apt-get update && sleep 6 && /usr/bin/apt-get dist-upgrade && /usr/bin∕apt-get autoremove'"
17:42 melodie it triggers a python error but goes to the end of the command line
17:44 pdurbin cool
17:45 melodie for the non gui version, should I make it a /bin/sh script or a /bin/bash would be better?
17:46 melodie http://pastebin.fr/51961
17:46 melodie this is what it looks like now
17:46 melodie can you tell me if it's good or bad, if the ping will work "as is" ?
17:47 melodie the name of the file for now is "system-update-by-cron.sh"
17:49 melodie about the python errors, I pastebin them here incase someone can provide me with some kind of explanation :) http://pastebin.fr/51962
17:55 melodie pdurbin heading to prepare dinner, when someone has answers I'll come read them or on the log page

| Channels | #crimsonfu index | Today | | Search | Google Search | Plain-Text | summary

crimsonfu - sysadmins who code