User Controls
Posts by gadzooks
-
2019-03-05 at 5:42 AM UTC in Bongespob Rectanglepants
-
2019-03-05 at 3:58 AM UTC in It bleeds one week out of the month
-
2019-03-05 at 3:56 AM UTC in It bleeds one week out of the month
-
2019-03-05 at 3:54 AM UTC in Colder than a witch's tit
Originally posted by GGG Then why the fuck do you live in Canada?
Vancouver is like... the honorary American city, with all the pros of being part of Canada.
Most of Canada sucks.
Vancouver, and surrounding areas, are absolutely perfect.
Well, minus the cold. But the cold (and expensive real estate) are a relatively small price to pay. -
2019-03-05 at 3:52 AM UTC in Colder than a witch's tit
Originally posted by Nil I gotta walk to the city tomorrow, should be a balmy minus 17c in the morning.
God i hope somebody stops, if not 2 hour walk.
I don't envy you, being in Edmonton and all.
Vancouver's bad enough.
But I know Edmonton (and much of the rest of Canada) are a lot worse.
I used to live in Ottawa and Winter's there were absolutely brutal. -
2019-03-05 at 3:52 AM UTC in Colder than a witch's titI can't stand Winter, I can't stand cold, and I have some pathological fear of snow.
-
2019-03-05 at 3:34 AM UTC in Lanny has removed the canary in the 'About' page
-
2019-03-05 at 3:32 AM UTC in Lanny has removed the canary in the 'About' page
-
2019-03-05 at 3:29 AM UTC in 20xrp to the first person who can guess my altIt's an all-out alt assault.
-
2019-03-05 at 3:15 AM UTC in It bleeds one week out of the month
-
2019-03-05 at 3:15 AM UTC in It bleeds one week out of the month
-
2019-03-05 at 2:46 AM UTC in It bleeds one week out of the monthIs that a kool-aid tea bag?
-
2019-03-05 at 1:36 AM UTC in Buy Real and Fake passport,drivers license,green card,Id cards and diplomats.(http://www.buyfakedocs.com)Actually wait!
I want to buy a diplomat. -
2019-03-05 at 1:35 AM UTC in Buy Real and Fake passport,drivers license,green card,Id cards and diplomats.(http://www.buyfakedocs.com)Faggot.
-
2019-03-05 at 12:32 AM UTC in Aliens Cause Global Warming
-
2019-03-05 at 12:21 AM UTC in Aliens Cause Global Warming
Originally posted by 34nfi4w8g3wnfge4j93qrj309jg How did they know how hot it was in the 1400's if there was no computers back then
They estimate trends in global temperatures by aggregating data from different sources.
Originally posted by Wikipedia Quantities such as tree ring widths, coral growth, isotope variations in ice cores, ocean and lake sediments, cave deposits, fossils, ice cores, borehole temperatures, and glacier length records are correlated with climatic fluctuations.
Basically, if you have sufficient correlational data, you can draw fairly confident quantitative conclusions. -
2019-03-04 at 11:40 PM UTC in Shell script thread
Originally posted by Sophie Personally, i try to use PowerShell a lot as well, on Windows, it's good for automation and security oriented scripting too.
The funny thing is, as much as I use Windows, I have yet to learn even the basics of PowerShell. It's on my To Do list, but just kinda low priority compared to other things so I haven't made much progress in that regard.
Originally posted by Sophie I do a lot of cross-platform dev stuff as well though
My exact set-up is as follows:
Home computers are all Windows (except for a couple of "headless" Raspberry Pi's that I use for local "web" storage and local git repository storage).
Then, I use a plethora of cloud-based virtual machines (AWS, Digital Ocean, etc) all running Linux.
Then I just use SSH (PuTTY) and SCP (WinSCP), and various python scripts, to interact with the virtual machines (and my local RPi's).
To some it might seem a bit convoluted, but it's what works best for me. -
2019-03-04 at 11:14 PM UTC in Shell script threadI am fairly proficient with Bash, but only out of necessity (having to interpret other people's scripts, for example).
But I think one of the biggest reasons I'm so drawn to using Python instead is because I use Windows just as much as I use Linux, and Python scripts will work almost identically on both environments (barring maybe the occasional minor necessary tweak).
And since I have yet to encounter any shell tasks that can't be done with Python, I remain fully sold on Python.
Although one factor I will concede on is that Python is technically an unnecessary dependency (since all Linux kernels incorporate Bash right out of the box). I suppose if I were writing an automation script for a work-related project, I'd probably use Bash. Actually, I pretty much always have to have some kind of init.sh for initializing Docker containers, but they're usually pretty simple scripts for the most part. -
2019-03-04 at 10:38 PM UTC in Shell script threadI pretty much exclusively use Python for task automation scripting because it's always more concise (fewer lines of code), and a lot more readable (at least IMO).
For example, converting that backup automation script from Bash to Python:
Originally posted by Merlin
# firsts make array of folder names
i=0
files[0]=""
for f in ${folder}_*
do
files[i]=$f
((i++))
done
# sort them by actual timestamp
for (( i = (${#files[@]}-1); i >= 0; i-- )); do
for (( j = 1; j <= $i; j++ )); do
if [ $(stat -c %Y ${files[$j-1]}) -gt $(stat -c %Y ${files[$j]}) ]
then
tmp=${files[$j-1]}
files[$j-1]=${files[$j]}
files[$j]=$tmp
fi
done
done
The above lines of code can be condensed into the following two lines:
# MAKE ARRAY OF FOLDER NAMES... #
folders = glob.glob(folder+'_*')
# SORT BY TIMESTAMP... #
folders = sorted(folders, key=lambda file: (int(file[-4:]), int(file[-6:-5])))
Originally posted by Merlin
# check there is an old copy
if [ ${files[${#files[@]}-1]} != "${folder}_*" ]
then
# if the last copy is labelled more than a month old: copy it
lastMonth=${files[${#files[@]}-1]:${#folder}+1:2}
lastYear=${files[${#files[@]}-1]:${#folder}+4:2}
if [ $curYear -gt $lastYear ]
then
cp -r $folder ${folder}_${curMonth}_${curYear}
files[${#files}]=${folder}_${curMonth}_${curYear}
elif [ $curMonth -gt $lastMonth ] && [ $curYear -eq $lastYear ]
then
cp -r $folder ${folder}_${curMonth}_${curYear}
files[${#files}]=${folder}_${curMonth}_${curYear}
fi
else
# there only exists the main backup, no versioning yet, create one
cp -r $folder ${folder}_${curMonth}_${curYear}
files[${#files}]=${folder}_${curMonth}_${curYear}
fi
This segment of code, well... I'm still trying to fully parse and translate it, because I'm not even totally sure what's different between what's happening in the three different conditions here.
Originally posted by Merlin
# trim extra files that might exist
for (( i = ${#files[@]}-1; i >=0; i--)); do
if [ $versions -le 0 ]
then
rm -r ${files[$i]}
fi
((versions--))
done
This can be reduced to a mere two lines of code:
# TRIM EXTRA FILES THAT MIGHT EXIST... #
for f in folders[:-versions]:
rmtree(f)
I guess it ultimately depends on personal preferences and so on, but I will always prefer Python for shell scripting over Bash. -
2019-03-04 at 10:34 AM UTC in I am now moderator of Half BakedLies all around.
Anyway, I do my own finny-blocking.
Y'all motherfuckers need GreaseMonkey.