This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make sure only root can run our script | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
awk -F':' '{ print $1}' /etc/passwd | grep aluno > usrs | |
cat usrs | while read line; do | |
userdel -r $line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Needs apt install nmap | |
nmap -sP 192.168.1.* | grep for | awk {'print $5 " " $6'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Name=Android Studio | |
Exec="/opt/android-studio/bin/studio.sh" %f | |
Icon=/opt/android-studio/bin/studio.png | |
Categories=Development;IDE; | |
Terminal=false | |
StartupNotify=true | |
StartupWMClass=jetbrains-android-studio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Version=1.0 | |
Name=Packet Tracer 7 | |
Exec=/opt/pt/packettracer | |
Terminal=false | |
X-MultipleArgs=false | |
Type=Application | |
Icon=/opt/pt/art/app.png | |
Categories=Development; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Desvio medio absoluto | |
function dam(input){ | |
let sum = input.reduce((acc,val) => acc+val); | |
let mean = sum/input.length; | |
let desvAbs = input.map(val => Math.abs(val - mean)); | |
let sumDesv = desvAbs.reduce((acc,val) => acc+val); | |
return sumDesv/input.length; | |
} | |
console.log(dam([34,29,39,34])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stdDeviation(input, isAmostra){ | |
let amostral = 0; | |
if(isAmostra != null) amostral = 1; | |
let sum = input.reduce((acc,val) => acc+val); | |
let mean = sum/input.length; | |
let diff2 = input.map(val => Math.pow(val - mean,2)); | |
let sumDiff = diff2.reduce((acc,val) => acc+val); | |
let desv = Math.sqrt(sumDiff/(input.length-amostral)); | |
console.log(mean); | |
console.log(desv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# HOW TO INSTALL: move to /usr/bin and change permissions to execute | |
if [ "$1" == "--help" ]; then | |
cat << EOF | |
Usage: rename2dos pathfolder counter | |
pathfolder --> Initial folder | |
counter --> Restart counter added in filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf ~/Downloads && ln -s /mnt/d/Downloads/ ~/Downloads | |
rm -rf ~/Documentos && ln -s /mnt/d/Documents/ ~/Documentos | |
rm -rf ~/Imagens && ln -s /mnt/d/Pictures/ ~/Imagens | |
rm -rf ~/Música && ln -s /mnt/d/Music/ ~/Música | |
rm -rf ~/Vídeos && ln -s /mnt/d/Videos/ ~/Vídeos | |
rm -rf ~/Modelos && ln -s /mnt/d/Models/ ~/Modelos | |
rm -rf ~/Público && ln -s /mnt/d/Public/ ~/Público |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function expressionsWithoutIf { | |
A=$1 | |
B=$2 | |
[ "$A" -ge "$B" ] ; C=$? | |
if [ "$C" == "0" ]; then | |
echo "TRUE!" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GithubId="ailtonbsj" | |
Email="ailton.ifce@gmail.com" | |
AppDomain="com.github.ailtonbsj" | |
AppName="sample" | |
AppNameEn="Sample" | |
AppNameBr="Exemplo" | |
Comment="A Sample of application" | |
CommentBr="Um exemplo de aplicativo" |
OlderNewer