I spent the last three days reading Python guides, manuals, blogs, tutorials, e-books, etc. just to be able to start working with data in text format I gathered from sensors and text format tables.
I got stuck because I was incorrectly trying to use csv methods to manipulate a file that I read into a string, and wrongly though I could just format it as a standard csv file layout. This just does not work!
The official doc for csv.reader() at https://docs.python.org/2/library/csv.html is very helpful, which stats this:
"file objects and list objects are both suitable"
The solution is to convert your formatted string to a "file or list object", (what ?!?)
The side effect of not doing this is that all csv methods don't fetch the items correctly and ignores your delimiters (ie. like the comma)
So you have two ways of doing this:
First: you can import StringIO to perform this conversion:
from IO import StringIO
import csv
After that you need to code the conversion, and for this example lets assume your string is named: target
new_csv = StringIO(target)
But wait!!! Hold your horses!!! Keep on reading.
Second: Or choose a easier way, that is: make a list from your string:
new_csv = target.splitlines()
You can check the type of objects with:
print('type of target = '+str(type(target)))
print('type of new_csv = '+str(type(new_csv)))
Now you are ready to use all the csv methods to analise/manipulate your tables/data
Cheers!
sexta-feira, 20 de dezembro de 2019
quinta-feira, 5 de dezembro de 2019
Check your link speed to all servers in location
So I had same problems with my local xDSL provider.
To be able to test the speed of connection we can use the speedtest site or a bash script from a GitHub developer, but I created the following bash script which will use the speedtest script to test the speed on all the servers in my city and save it to a log file.
To be able to test the speed of connection we can use the speedtest site or a bash script from a GitHub developer, but I created the following bash script which will use the speedtest script to test the speed on all the servers in my city and save it to a log file.
#!/bin/bash
#
# speedtest all my city servers
#
# Author: braselectron.com 05/DEZ/2019
#
#
# ref:
# curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
#
# dependencies:
#
# 1) wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
#
# 2) ubuntu 18.04
#
# 2.1) GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
#
# 3) http://ipinfo.io/ip # for external IP fetch
#
#
targetcity="Miami"
# if target city name has spaces change it for grep \s like
# this: "Salt\sLake\sCity"
gtarget=$( echo "$targetcity" | sed "s/ /\\\s/g )
#
servers=$( python speedtest.py --list | grep $gtarget )
# debug:
# echo -e "I found these servers:\n$servers"
servnum=$( echo -e "$servers" | cut -d ')' -f 1 )
# debug:
# echo -e "These are the server numbers:\n$servnum"
tot=$( echo -e "$servnum" | wc -l )
echo -e "\nRunning, please wait $tot servers to go:\n"
#
echo -e "Speedtest "$( wget -qO - http://ipinfo.io/ip )" "$( date +%F )"\n" > speedtest_$( date +%F ).log
#
i=1
#
for serv in $servnum
do
echo -e "$i of $tot - ($serv): "
python speedtest.py --server $serv 2>&1 | grep ':' |\
sed "s/$targetcity/$serv/g" |\
sed "s/.*ERROR.*/Server is not responding/g" |\
tee -a speedtest_$( date +%F ).log
echo -e "" | tee -a speedtest_$( date +%F ).log
sleep 1
((i++))
#
done
echo ""
Cheers!
#
# speedtest all my city servers
#
# Author: braselectron.com 05/DEZ/2019
#
#
# ref:
# curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
#
# dependencies:
#
# 1) wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
#
# 2) ubuntu 18.04
#
# 2.1) GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
#
# 3) http://ipinfo.io/ip # for external IP fetch
#
#
targetcity="Miami"
# if target city name has spaces change it for grep \s like
# this: "Salt\sLake\sCity"
gtarget=$( echo "$targetcity" | sed "s/ /\\\s/g )
#
servers=$( python speedtest.py --list | grep $gtarget )
# debug:
# echo -e "I found these servers:\n$servers"
servnum=$( echo -e "$servers" | cut -d ')' -f 1 )
# debug:
# echo -e "These are the server numbers:\n$servnum"
tot=$( echo -e "$servnum" | wc -l )
echo -e "\nRunning, please wait $tot servers to go:\n"
#
echo -e "Speedtest "$( wget -qO - http://ipinfo.io/ip )" "$( date +%F )"\n" > speedtest_$( date +%F ).log
#
i=1
#
for serv in $servnum
do
echo -e "$i of $tot - ($serv): "
python speedtest.py --server $serv 2>&1 | grep ':' |\
sed "s/$targetcity/$serv/g" |\
sed "s/.*ERROR.*/Server is not responding/g" |\
tee -a speedtest_$( date +%F ).log
echo -e "" | tee -a speedtest_$( date +%F ).log
sleep 1
((i++))
#
done
echo ""
sexta-feira, 22 de novembro de 2019
How to list, delete and include iptables rules.
First you should list all rules and index tem so you can pinpont your request correctly:
Note: the -n means to not use DNS to resolve IP; the -L means to list rules; --line-numbers you can guess what it means.
Now you can choose a "chain", in this example: "INPUT" and use the "-D" to indicate delete and the final number is point to rule "5"
You can also add a rule, and bellow I will use chain INPUT for a known hacker from Kenya, Africa:
That's it for now.
Cheers! and Shields up!
sudo iptables -nL --line-numbers
Note: the -n means to not use DNS to resolve IP; the -L means to list rules; --line-numbers you can guess what it means.
Now you can choose a "chain", in this example: "INPUT" and use the "-D" to indicate delete and the final number is point to rule "5"
sudo iptables -D INPUT 5
You can also add a rule, and bellow I will use chain INPUT for a known hacker from Kenya, Africa:
sudo iptables -I INPUT 1 -s 197.248.0.0/16 -j DROP
That's it for now.
Cheers! and Shields up!
sábado, 26 de outubro de 2019
How to recover packages to local cache - Ubuntu
A few days ago I had to "sudo apt clean" my local cache to uninstall a bad package, but I needed to recover my cache, with the installed packages, since I work often in offline places, so that I can recover from a broken system without an active Internet connection.
So to be able to recover, or better, rebuild (or re-cache) your packages to your local storage (ie HDD or SSD) that usually is located at: /var/cache/apt/archives we have to do this:
1) get the installed package names:
dpkg -l | grep "^ii" | awk ' {print $2} ' > pkg_names.txt
2) get the installed package versions:
dpkg -l | grep "^ii" | awk ' {print $3} ' > pkg_version.txt
3) combine all package names and versions:
paste -d"=" pkg_names.txt pkg_version.txt > pkg_combine.txt
4) now download packages to cache:
cat pkg_combine.txt | xargs sudo apt-get -y install --reinstall --download-only
REF:
dpkg -l | grep "^ii"| awk ' {print $2} ' | xargs sudo apt-get -y install --reinstall --download-only
dpkg -s firefox | grep Version | awk ' {print $2} '
sudo apt-get install package=version
Todo:
Timeout each line to avoid long loops (when source is dead or pkg not available at repository)
So to be able to recover, or better, rebuild (or re-cache) your packages to your local storage (ie HDD or SSD) that usually is located at: /var/cache/apt/archives we have to do this:
1) get the installed package names:
dpkg -l | grep "^ii" | awk ' {print $2} ' > pkg_names.txt
2) get the installed package versions:
dpkg -l | grep "^ii" | awk ' {print $3} ' > pkg_version.txt
3) combine all package names and versions:
paste -d"=" pkg_names.txt pkg_version.txt > pkg_combine.txt
4) now download packages to cache:
cat pkg_combine.txt | xargs sudo apt-get -y install --reinstall --download-only
REF:
dpkg -l | grep "^ii"| awk ' {print $2} ' | xargs sudo apt-get -y install --reinstall --download-only
dpkg -s firefox | grep Version | awk ' {print $2} '
sudo apt-get install package=version
Todo:
Timeout each line to avoid long loops (when source is dead or pkg not available at repository)
quarta-feira, 16 de outubro de 2019
List total hits of iptable drops
I have been busy making and studying defense strategies to better implement and monitor my firewall system.
So after you have decided to insert DROP rules in your iptables, it is a good practice to check the statistics of how efficient the additional "load" has been to your overall performance, that is, is it effective or should you leave it for fail2ban to control the hits ?
I made a bash script to summaries the hits on iptables rules to avoid all the stdout that obfuscates the important information.
As usually sad, use at your own risk. Make a backup plan before proceeding.
#!/bin/bash
#
# check how many hits on iptables drop rule
# by braselectron.com OCT 16, 2019
#
# iptables formated output example needed:
# '0 0 DROP all -- any any 47.203.94.77 anywhere'
#
# so now clear and fix the spaces on the output
#
readarray iptls <<< "$(sudo iptables -vnL | grep DROP |\
sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' |\
sed 's/^ //g')"
#
# debug point
# echo "iptls lenght is ${#iptls[@]}"
#
echo -e "Hits\tTarget Denied"
for element in "${iptls[@]}"
do
#
# debug point
# echo "> $element"
#
verify=( $(echo "$element" | cut -d " " -f 1) )
#
# debug point
# echo "verify = $verify"
#
if [ "$verify" -ne "0" ]; then
hits="$verify"
target=( $(echo "$element" | cut -d " " -f 8) )
echo -e "$hits\t$target"
fi
done
#
# check how many hits on iptables drop rule
# by braselectron.com OCT 16, 2019
#
# iptables formated output example needed:
# '0 0 DROP all -- any any 47.203.94.77 anywhere'
#
# so now clear and fix the spaces on the output
#
readarray iptls <<< "$(sudo iptables -vnL | grep DROP |\
sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' |\
sed 's/^ //g')"
#
# debug point
# echo "iptls lenght is ${#iptls[@]}"
#
echo -e "Hits\tTarget Denied"
for element in "${iptls[@]}"
do
#
# debug point
# echo "> $element"
#
verify=( $(echo "$element" | cut -d " " -f 1) )
#
# debug point
# echo "verify = $verify"
#
if [ "$verify" -ne "0" ]; then
hits="$verify"
target=( $(echo "$element" | cut -d " " -f 8) )
echo -e "$hits\t$target"
fi
done
If all goes well you will get a output similar to this:
Hits Target Denied
1 198.108.66.0/23
4 92.118.161.0/24
3 92.118.160.0/24
1 74.82.47.0/24
1 185.173.35.0/24
1 71.6.128.0/17
2 122.228.0.0/16
4 95.154.101.209
1131 139.59.13.150
1 198.108.66.0/23
4 92.118.161.0/24
3 92.118.160.0/24
1 74.82.47.0/24
1 185.173.35.0/24
1 71.6.128.0/17
2 122.228.0.0/16
4 95.154.101.209
1131 139.59.13.150
But this is based on my active iptables rules.
Shields up captain!
Cheers!
How to fix id3tag of mp3 files
Preliminary notes:
Basic knowledge:
See http://id3.org/id3v2.4.0-frames for allowed picture types.
Examples:
On the next part you must change the input, out.mp3 and cover.png to your own fit.
1) Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
2) To attach a picture to an mp3 file select both the audio and the picture stream with map:
3) Write a "clean" MP3 without any extra features:
Let's get work done:
So this is what I did to add a cover image to a mp3 that already had id3tags:
Other thoughts:
After it runs you will have a sub-folder with the new mp3 files all with the embedded cover image you inserted with the script.
Have fun! Cheers!
This post is the sum of many hours of researching the web for solutions, reading for many hours: man, info and community pages. And a lot of testing.
This is a solution for Linux users (probably also good for MacOS too). MS Windows user, sorry, you need to contact MS support for help.
Part of the following is cut/past form other sources I found on the web. Thank you for the active community of Linux users like me.
As usually noted, the following is for sharing knowledge only, do it at your own risk! Make a backup plan before proceeding.
Basic knowledge:
Libavformat (lavf) is a library for dealing with various media container formats. Its main two purposes are demuxing - i.e. splitting a media file into
component streams, and the reverse process of muxing - writing supplied
data in a specified container format.
The MP3 muxer writes a raw MP3 stream with the following optional features:
An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and 2.4 are supported, the id3v2_version private option controls which one is used (3 or 4).
Setting id3v2_version to "0" disables the ID3v2 header completely.
The muxer usually support writing attached pictures (APIC frames) to the ID3v2 header. The pictures are supplied to the muxer in form of a video stream with a single packet. There can be any number of those streams, each will correspond to a single APIC frame. The stream metadata tags title and comment map to APIC description and picture type respectively.
See http://id3.org/id3v2.4.0-frames for allowed picture types.
Note that the APIC frames must be written at the beginning, so the muxer will buffer the audio frames until it gets all the pictures. It is therefore advised to provide the pictures as soon as possible to avoid excessive buffering. Also keep picture small (ie. less than 1% of total mp3 size is a good rule/target to follow).
A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by default, but will be written only if the output is seekable. The write_xing private option can be used to disable it. The frame contains various information that may be useful to the decoder, like the audio duration or encoder delay.
A legacy ID3v1 tag at the end of the file (disabled by default). It may be enabled with the write_id3v1 private option, but as its capabilities are very limited, its usage is not recommended. This is important for old mp3 players that only understand ID3v1 tags.
Examples:
On the next part you must change the input, out.mp3 and cover.png to your own fit.
1) Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
ffmpeg -i input.mp3 -id3v2_version 3 -write_id3v1 1 out.mp3
2) To attach a picture to an mp3 file select both the audio and the picture stream with map:
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1 \
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
3) Write a "clean" MP3 without any extra features:
ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
Let's get work done:
So this is what I did to add a cover image to a mp3 that already had id3tags:
ffmpeg -i orignal.mp3 -i cover.jpg -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v comment="Cover (Front)" final.mp3
Other thoughts:
I did use a jpeg image for the cover and ffmpeg accepted it as well as vlc, mpv and other players I tested did work fine.
So if you need to include the same cover on many files (ie an album) in a folder, you can do this:
1) "cd" to the target folder
2) "mkdir new" in the target folder
3) rename the cover image file to cover.<ext> where <ext> could be png or jpg depends on your choice and particular case, or convert it to jpg.
3) then copy and past the following script (and hit the [ENTER] key):
So if you need to include the same cover on many files (ie an album) in a folder, you can do this:
1) "cd" to the target folder
2) "mkdir new" in the target folder
3) rename the cover image file to cover.<ext> where <ext> could be png or jpg depends on your choice and particular case, or convert it to jpg.
3) then copy and past the following script (and hit the [ENTER] key):
for file in *.mp3; do ffmpeg -i "${file}" -i cover.jpg \
-map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v \
comment='Cover (Front)' ./new/"${file}"; done
-map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v \
comment='Cover (Front)' ./new/"${file}"; done
After it runs you will have a sub-folder with the new mp3 files all with the embedded cover image you inserted with the script.
Have fun! Cheers!
quarta-feira, 25 de setembro de 2019
Check your servers are UP - Linux BASH
Recently I was trying to check if one of my servers had a glitch, so after some research and coding I came up with this solution for Linux (ie. in my case for Raspbian Jessie):
1) Get the following code and save it to your target server.
2) Choose another host on your network to ping that is up (for sure) and is trusted by you. For example: 192.168.0.1 (usually the router on your network - default factory value).
3) Now using "nohup" to setup your test on the target host, at the command terminal, do this:
4) Now you can logoff and from time to time check the nohup.out file to see if the ping failed.
5) When you are satisfied with your tests just kill the process on the target host, doing this:
5.1) first find your process with: ps -ef | grep test_alive
This will give you a output similar to this:
pi 1257 4688 1 17:59 pts/1 00:00:00 grep --color=auto test_alive
pi 22213 1 9 15:08 ? 00:16:24 /bin/bash test_alive.sh 192.168.0.1
5.2) get the process id and kill it with: kill 22213 # caution! use your id number
5.3) and remove the nohup.out file with: rm nohup.out
NOTE: if the nohup.out file is empty, means no erros, your server is working and connectivity is working. But if the target host is freezing or other problems that make the script stop, this may mislead your conclusion.
Cheers!
1) Get the following code and save it to your target server.
#!/bin/bash
#
# Test connectivity with ping
# filename: test_alive.sh
#
# braselectron.com - September 25, 2019
#
# get IP from command line argument
#
ip=$1
#
# check IP address format code
# Mitch Frazier - Linux Journal - June 26, 2008
#
valid_ip () {
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
}
#
# check syntax
#
if [ $# -eq 0 ]
then echo "syntax: test_live.sh <ip address>"
exit 1
fi
#
if ! valid_ip $ip
then echo "IP is invalid"
exit 1
fi
#
# ping but don't wait
# log if ping fails
#
while true
do ping -w 1 -c 1 $ip |\
grep received |\
cut -d" " -f 4 |\
if [ "$(cat -)" != "1" ]
then echo "Ping failed $(date)"
fi
done
#
# Test connectivity with ping
# filename: test_alive.sh
#
# braselectron.com - September 25, 2019
#
# get IP from command line argument
#
ip=$1
#
# check IP address format code
# Mitch Frazier - Linux Journal - June 26, 2008
#
valid_ip () {
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
}
#
# check syntax
#
if [ $# -eq 0 ]
then echo "syntax: test_live.sh <ip address>"
exit 1
fi
#
if ! valid_ip $ip
then echo "IP is invalid"
exit 1
fi
#
# ping but don't wait
# log if ping fails
#
while true
do ping -w 1 -c 1 $ip |\
grep received |\
cut -d" " -f 4 |\
if [ "$(cat -)" != "1" ]
then echo "Ping failed $(date)"
fi
done
2) Choose another host on your network to ping that is up (for sure) and is trusted by you. For example: 192.168.0.1 (usually the router on your network - default factory value).
3) Now using "nohup" to setup your test on the target host, at the command terminal, do this:
nohup /bin/bash test_alive.sh 192.168.0.1 &
# remember to rename the 192.168.0.1 with your host IP (step 2)
# remember to rename the 192.168.0.1 with your host IP (step 2)
4) Now you can logoff and from time to time check the nohup.out file to see if the ping failed.
5) When you are satisfied with your tests just kill the process on the target host, doing this:
5.1) first find your process with: ps -ef | grep test_alive
This will give you a output similar to this:
pi 1257 4688 1 17:59 pts/1 00:00:00 grep --color=auto test_alive
pi 22213 1 9 15:08 ? 00:16:24 /bin/bash test_alive.sh 192.168.0.1
5.2) get the process id and kill it with: kill 22213 # caution! use your id number
5.3) and remove the nohup.out file with: rm nohup.out
NOTE: if the nohup.out file is empty, means no erros, your server is working and connectivity is working. But if the target host is freezing or other problems that make the script stop, this may mislead your conclusion.
Cheers!
segunda-feira, 23 de setembro de 2019
quarta-feira, 11 de setembro de 2019
Transformar 2014 - Palestra Mitchel Resnick
Mitchel Resnick, diretor do grupo Lifelong Kindergarten, do MIT Media
Lab (Massachussets, EUA), apresentou a palestra "Aprender a programar,
programar para aprender", durante o Transformar 2014.
O projeto Lifelong Kindergarten desenvolve novas tecnologias que, no espírito dos blocos e tintas de dedo do jardim de infância, expandam o alcance do que as pessoas podem projetar, criar e aprender.
O Transformar foi realizado no dia 28 de julho de 2014, em São Paulo, pelo Inspirare/Porvir, Fundação Lemann e Instituto Península, com apoio de Google, Globo e Canal Futura.
Para mais informação acesse:
http://www.transformareducacao.org.br
Para saber mais sobre o scratch:
https://www.raspberrypi.org/documentation/usage/scratch/
Isto é uma continuação do "post" sobre Raspberry Pi aqui:
https://braselectron.blogspot.com/2014/10/raspberry-pi-na-globo-news-ferramenta.html
O projeto Lifelong Kindergarten desenvolve novas tecnologias que, no espírito dos blocos e tintas de dedo do jardim de infância, expandam o alcance do que as pessoas podem projetar, criar e aprender.
O Transformar foi realizado no dia 28 de julho de 2014, em São Paulo, pelo Inspirare/Porvir, Fundação Lemann e Instituto Península, com apoio de Google, Globo e Canal Futura.
Para mais informação acesse:
http://www.transformareducacao.org.br
Para saber mais sobre o scratch:
https://www.raspberrypi.org/documentation/usage/scratch/
Isto é uma continuação do "post" sobre Raspberry Pi aqui:
https://braselectron.blogspot.com/2014/10/raspberry-pi-na-globo-news-ferramenta.html
domingo, 1 de setembro de 2019
Telegram - My phone got stolen (or lost), now what ?
My phone was stolen, what do I do?
First of all, sorry about your phone. Unfortunately, the phone number
is the only way for us to identify a Telegram user at the moment. Telegram doesn‘t collect additional information about you, so whoever has the
number, has the account. This means we can’t help you unless you have
access either to the phone number or to Telegram itself on any of your
devices.
If you have access to Telegram on another device:
- Go to Telegram Settings — Privacy and Security and turn on Two-Step Verification. This way the phone number alone will not be enough to log in to your account.
- Go to Settings — Privacy and Security — Active Sessions and terminate your Telegram session on the old device. Whoever has your phone will not be able to log in again, since they don't know your password.
- Contact your phone provider, so that they block your old SIM and issue a new one with your number.
- If you decide to switch to a new phone number, don't forget to go to Settings, tap on your phone number and change your Telegram number to the new one.
I don't have access to Telegram on any other devices:
- First and foremost, you need to contact your phone provider, so that they block your old SIM and issue a new one with your number.
- Wait till you receive your new SIM with the old number, log in to Telegram, then go to Settings — Privacy and Security — Active Sessions and terminate your Telegram session on the old device.
Removing sensitive data
Common thieves usually throw out the SIM card immediately (the phone
is harder to locate this way), then wipe the devices and sell them, so
there isn't much risk for the data in case of regular petty theft. But
if you have reasons to worry about the data on the device and are unable
to log out the other device, it is best that you wipe it remotely. You can read more about it here: Apple iOS, Android. Unfortunately, this requires you to have prepared in advance for this scenario.
You can delete your Telegram account
if you are logged in on at least one of your other devices (mobile or
desktop). Note that inactive Telegram accounts self-destruct
automatically after a period of time — 6 months being the default
setting.
Last but not least
My final advice is to always install Telegram at least on two devices (ie. your phone and your laptop/desktop/tablet) and activate the Two-Step
Verification, just to be safe.
REF: https://telegram.org/faq#deleting-contacts-on-android
quarta-feira, 21 de agosto de 2019
How to Stop Media Autoplay in Firefox 68+
Firefox autoplay extensions changed again.
It is a pain in the a** to understand why they keep changing these parameters.
As usual, must be to make this "easier" for users!
Starting in Firefox 68, the about:config parameters changed in regards to Firefox's autoplay blocking behavior, with are now:
media.autoplay.default
UPDATE (for 68.4.1 esr - 64-bit):
1) Adjust these settings:
https://addons.mozilla.org/en-US/firefox/addon/disable-autoplay/
Those changes take effect for any new pages that you open after making the change.
REF: https://major.io/2018/12/18/disable-autoplay-for-videos-in-firefox-65/
It is a pain in the a** to understand why they keep changing these parameters.
As usual, must be to make this "easier" for users!
Starting in Firefox 68, the about:config parameters changed in regards to Firefox's autoplay blocking behavior, with are now:
media.autoplay.default
- Value 5: Block audio and video
- Value 1: Block audio
- Value 0: allow
- Value True: Block
- Value False: Allow
- Value True: Require user interaction
- Value False: Don't require user interaction
- media.autoplay.enabled
- media.autoplay.allow-muted
UPDATE (for 68.4.1 esr - 64-bit):
1) Adjust these settings:
- Set
media.autoplay.default
to1
to disable video autoplay for all sites - Set
media.autoplay.allow-muted
tofalse
to disable video autoplay even for muted videos
https://addons.mozilla.org/en-US/firefox/addon/disable-autoplay/
Those changes take effect for any new pages that you open after making the change.
REF: https://major.io/2018/12/18/disable-autoplay-for-videos-in-firefox-65/
segunda-feira, 15 de julho de 2019
Microsoft Windows lost files for no apparent reason explained
These last days, I accidentally step over a very old Windows bug that I had no clue.
While I was tweaking my new installation of Ubuntu 18.04 on my Lenovo U430 laptop, which I changed the original 500GB HDD for a 250GB SSD for better energy and overall performance and to stop the OEM Windows 8.1 install from corrupting my Grub (ie. forcing me to return to M$Win - sneaky peeking on my options every few days).
So on the help pages of the only windows applications that I still use under wine (because there isn't a port yet) I found this, in the new updated version:
"There are two bugs in Windows that give some users trouble. Both bugs relate to Windows hiding the true file name and path of files. Since it is common to use foreign (i.e., third party) files in combination with main application, this can cause confusion.
To circumvent these bugs, please follow the following steps.
First, in Windows Explorer, goto to folder options, view, and uncheck 'Hide extensions for known file types.'
Second, on Vista or Windows 7 turn off User Account Control(UAC).
UAC can cause the path of files to be different depending on which application is used to view the directory.
This breaks the fundamental paradigm of storing files in a computer by name.
Is it is strongly recommended that you disable UAC. Otherwise it might appear that you have lost files for no apparent reason."
Thank you God and bless Linus Torvalds, who has made Linux a true freedom of choice option, with no hidden buggy traps!
quarta-feira, 20 de fevereiro de 2019
LTS lifecycle for Ubuntu
Although security is a very important
subject (one of the most important), I’d take the opportunity focus on
the "LTS lifecycle".
What got my attention when I moved my
private and "work" desktops, netbooks and laptops to Ubuntu back in 2006
was the fact that main goal of Ubuntu with the "Long Term Support" was
the "support", meaning: planning, work goals, security updates, patches
and documentations available online, and having people talk/blog about
how they fix bugs and explaining there solutions, this is the real
meaning of the word "ubuntu". But sadly now I have to move soon from
14.04.5 (ie I will be forced to upgrade) to 18.04.x, in the next few
weeks because of the deadline.
From a business point perspective, the
LTS lifecycle, considering the maturity and stability of a distribution,
only is achieved after 3 or more years of using, troubleshooting,
creating, cross-compiling, ... lots of hard work, showing that you need
to set at least 8 (eight) years as the goal for LTS!
I say this in respect to the great
effort and cost to upgrade a version, which impacts considerably the
working environment not only for the home, small, to medium and big
companies, specially when the hardware takes longer to update, in
realty, in most countries (ie. Africa, South America, middle East, etc)
at least 8 to 10 years is quite common.
As an example, my main working desktop,
here in Brazil, which I do most of my work, is a Gigabyte model:
965P-DS3, with a GeForce GT610, Intel Core2Duo 6300 with 8GB of RAM and
500GB HDD, which is an excellent work station for my needs, not only for
work, but for Internet browsing, banking, YouTube, office, etc. But
with limited BIOS features, makes it a real challenge and pain to
upgrade (specially for a fresh install).
It is not only a question of buying a
new hardware, which in my case, and in many countries, can be a very
expensive step (can cost up to 3x the price compared to the USA market),
but also because of ecological consciousness, carbon footprint, and who
really thinks about "ubuntu".
quarta-feira, 23 de janeiro de 2019
Ubuntu: The Entrepreneur who wants to give it all away
Financial Times,
20/01/2006
So you've made half a billion dollars and you have paid for a trip to space. What on earth do you do next? Some might consider politics, others would sit back and enjoy a life of leisure. But for technology entrepreneur and cosmonaut Mark Shuttleworth the next battle was to take on the might of Microsoft on its core territory - the desktop.
He has developed a complete suite of software for
personal computers that handles everything from the inner workings to
word processing. It is called Ubuntu, named after one of the founding
principles of post-apartheid South Africa, the country where he was
born. In both the Zulu and Xhosa languages, it means "humanity
to others".
The project is based on Linux, the free operating
system written largely by volunteers and widely used by businesses,
governments and other organisations to run servers, the computers
that sit at the heart of networks. Ubuntu is meant to take this
complex but powerful system and make it easy for non-technical people
to use. Hence the project's mission statement - "Linux for human
beings".
Although the technology behind it may be very
different, a computer running Ubuntu looks much like one running
Microsoft's Windows. The interface is based on similar menus, icons
and windows, and users can surf the internet with the popular Firefox
browser, or edit documents and spreadsheets with OpenOffice.
Instead of the largely blue world of Windows XP, Ubuntu is predominantly brown. Some quirky features hint at its African origin, such as the little burst of drumming that rings out when an application opens. Each new version of Ubuntu is known not just by the usual number, but an animal codename, such as Warty Warthog or Breezy Badger.
Less than two years after launch, Ubuntu has
established itself as a favourite among the hundreds of different
Linux-based operating systems. Ubuntu is top by some distance on a
popularity chart for different flavours of Linux compiled by the
website, DistroWatch. Exact numbers are hard to come by, but
estimates put the number of computers running Ubuntu at up to6m and
doubling everyeight months.
Unlike some of the other leading Linux projects,
such as Linspire, Novell and Red Hat, Ubuntu is distributed free.
Users can download it and use it without paying at all, and Mr
Shuttleworth's company, Canonical, will even post a free installation
compact disc to anyone who requests it.
This is possible because of Mr Shuttleworth's vast
fortune. He made $575m (£327m) selling his internet company, Thawte
Consulting, in 1999, and invests about $10m a year in Ubuntu. It is
unlikely to make him any money, at least not for several years.
Canonical sells support and related services for Ubuntu, but Mr
Shuttleworth has no firm idea about when it will make a profit.
He launched the project because he believes he is
in the vanguard of a revolution. "It is very high risk," he
says. "It is not a sensible business model. But shaping the
digital platform of the future is an incredibly interesting position
to be in."
He has certainly created a powerful and effective
desktop software package. From its commitment to freedom to its
quirky public image, Ubuntu has many appealing features and
considerable momentum. However, to continue growing at the current
rate, it will need to expand beyond its existing technology-savvy
base to embrace people with no prior experience of Linux.
Linux consultant and author Tom Adelstein thinks
it is still hard for such people to use. "From a usability point
of view, Ubuntu is ahead of the others, I think. But it is still in
the Linux bag - you have to be computer literate to use it. Microsoft
is still far ahead on that." Likewise, many buyers will be put
off by the fact that a number of programs, notably games, are not
available for Linux systems.
Few of those target users would install an
operating system themselves. So a key stage in Ubuntu's growth will
be persuading PC makers to sell machines with Ubuntu already
installed. Some computer makers already ship PCs with Linux suites
such as Linspire.
Smaller PC makers, competing at the lower end of
the market, are particularly interested in free software, as it helps
them to cut their prices. Small companies account for one-third of
the global market, according to research company IDC, and Mr
Shuttleworth is soon to visit Taiwan to open negotiations with some
of them.
Corporate and government desktops may also be
fertile ground for growth. A survey by Forrester, the research
company, found that 30 per cent of companies in North America are
considering switching some or all of their desktops to Linux.
Among those changing is Google, which has
developed its own version of Ubuntu, called Goobuntu. Mr Shuttleworth
says he is also in talks with the city government in Munich about
creating an edition of Ubuntu for them.
This ability to customise Linux is a big selling
point, and Canonical is developing an easy way for corporations to
design and maintain specific versions of Ubuntu to suit their exact
needs.
Although a stock-market darling such as Google may
seem an excellent reference customer, it has an intense rivalry with
Microsoft so it is keener than average to try alternatives to
Windows. Other organisations will need more convincing reasons to
adopt Ubuntu. Being free is clearly an advantage and Linux advocates
argue that the security and robustness of Linux products are superior
to those of Windows, although these issues are hotly debated.
Mr Shuttleworth has managed to rally one important
group around his standard: developers. Canonical has just 50 staff,
but Ubuntu has attracted many thousands of engineers at partner
companies, as well as volunteers and students, who do most of the
work of extending and improving the software.
The Ubuntu community has a reputation for
friendliness - which is important when you are not being paid. Also,
many developers who dislike the increasing commercialisation of other
Linux projects are attracted by Ubuntu's commitment to remaining
free.
However, selling Ubuntu beyond the circle of geeky
initiates will require a massive marketing and education process, and
even Mr Shuttleworth's deep pockets are no match for the budgets of
Microsoft and Apple. He hopes that the virtues of a free, open
operating system will sell themselves.
"My instinct tells me that free software is
going to be a significant force on the desktop," he says.
"Whether that is an Apple Mac-like force of 3-5 per cent; or
whether that is a Linux in the data centre [on servers] force, that
is 50 per cent and growing really, really fast - I don't know."
With no serious business plan, it would be easy to
dismiss Ubuntu as the plaything of a whimsical hobbyist that will not
go far beyond the geek fraternity. Can a Breezy Badger really be a
serious challenge to a titan like Microsoft?
During his interview with the Financial Times, Mr
Shuttleworth sits across his chair with both legs on the armrest, as
if it were a hammock - not something you imagine Larry Ellison,
Oracle's chief executive, doing.
But he has an impressive record, and you certainly
cannot question his dedication. He is currently on a gruelling
three-week world tour in his private jet, promoting Ubuntu and making
contacts in Croatia, Pakistan, India, China, Indonesia and Kenya.
After that, he plans to "unwind" by meeting other
enthusiasts for free software in, of all places, the war-torn
republic of Sierra Leone.
For some, Mr Shuttleworth just seems to be having
too much fun to be taken seriously. But Linux has surprised many
people before - there is nothing a geek finds more fun than turning a
whole industry on its head.
A STELLAR CAREER
Mark Shuttleworth has no clear idea of when his
new venture will make a profit but, based on his past experience,
tech watchers are treating the project seriously.
*Mark Shuttleworth made his fortune in 1999, when
Thawte Consulting, the company he started in a garage in Cape Town,
was bought by VeriSign for $575m. An e-commerce security company, it
did much to make the explosion of online retailing possible, and its
technology is still widely used today.
*In 2002, he spent $20m to join the Russian space
programme as a cosmonaut, training for a year before blasting off
from a launch pad in Kazakhstan. He was the first African in orbit
and the world's second paying visitor to space.
*After spending some time "sowing my wild
oats and enjoying the world", he decided to put his financial
and intellectual weight into a free software system for the desktop,
Ubuntu. "I was struck by the incredible pace of change in free
software to the desktop. It seemed to me that the key developers in
the free software world had identified the desktop as the next
interesting problem," he says. For him, it was a return tohis
origins, as the technology his first company developed was based on
Linux. "It was only possible for me to build Thawte because of
the existence of Linux," he says.
Copyright (c) Ben King MMVI
REF: https://web.archive.org/web/20101115224130/http://www.benking.co.uk/art/Ubuntu_the_entrepreneur_who_wants_to_give_it_all_away.php
Assinar:
Postagens (Atom)