add old scripts

This commit is contained in:
Tykayn 2022-05-30 11:36:14 +02:00 committed by tykayn
parent b505aa76fc
commit 920ffe9a91
19 changed files with 3265 additions and 0 deletions

55
bash/aliases.sh Executable file
View File

@ -0,0 +1,55 @@
# these bash aliases are meant to be added in your user folder,
# in a file named: .bash_aliases (with the dot at the beginning)
# done for my blog http://www.cipherbliss.com
########## lieux ###########
alias goserv='ssh monUtilisateur@monServeur.com/var/www/html'; # customise this one!
###### lieux locaux
alias gowork='cd /var/www/html/MON-PROJET-EN-COURS'; # customise this one!
alias gowww='cd /var/www/html'
################ symfony3 ######################
alias sf='php bin/console';
alias sfdsu='sf doctrine:schema:update --dump-sql';
alias sfdsuf='sf doctrine:schema:update --force';
alias sfcc='rm -rf app/cache/* && rm -rf app/logs/*';
alias sfdcc='sf doctrine:cache:clear-metadata && sf doctrine:cache:clear-query && sf doctrine:cache:clear-result ';
alias sfdge='sf doctrine:generate:entities Tykayn';
alias sfdsv='sf doctrine:schema:validate';
alias sfdges='sf doctrine:generate:entities Tykayn';
alias sffuc='sf fos:user:change-password';
alias c7='sudo chmod 777 -R';
alias ptest='phpunit -c app';
alias composer='/usr/local/bin/composer.phar';
alias sfad='sf assetic:dump';
alias sfai='sf assets:install';
alias yre='yarn run encore --dev';
alias yrep='yarn run encore --production';
################ system without graphic interface - command line ################
alias basha='nano ~/.bash_aliases'; # éditer les alisas
alias bashare='source ~/.bash_aliases'; # recharger les alias
alias ainstall='sudo apt-get install'; # installer un programme
alias apachere='sudo /etc/init.d/apache2 restart'; # apache restart
alias apacheconf='sudo nano /etc/apache2/apache2.conf'; # fichier de config apache2
alias phpini='sudo nano /etc/php5/apache2/php.ini'; # fichier de config de php5
alias tfa='tail -f /var/log/apache2/error.log'; # suivi des erreurs apache
alias aupg='apt-get update && apt-get upgrade';
################ système with X server ################
alias phpini='sudo gedit /etc/php5/apache2/php.ini';
################ git helpers ################
alias gci='git commit';
alias gco='git checkout';
alias gst='git status';
alias gbr='git branch';
alias gpull='git pull';
alias gpush='git push';
alias gpoush='git push'; # for slipping fingers
alias glg='git log --pretty=oneline';
alias myglg='git log --pretty=oneline --author=tykayn'; # log pour seulement mes commits, utile pour un stand up de projet Agile
alias gaci='git add . --all && git reset -- *.spec.js && git commit -m '; # ajouter sans les tests js, donnez le message du commit entre guillemets suite à cette commande
alias gaaci='git add . --all && git commit -m '; # ajouter sans les tests js
################ other helpers
alias hgrep="history |grep"

33
bash/convertJS2coffee.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
#text formatting
neutre='\e[0;m'
bleuclair='\e[1;34m'
bold=$(tput bold)
normal=$(tput sgr0)
# get the name of the js scripts folder
echo -e "${bleuclair} ${bold} conversion de projet ${normal} vers coffeescript "
read -p "nommez le dossier où se trouvent vos scripts .js [js]: " -e -i "js" name
# if the coffee folder doesnt exist, create it
if [ ! -e coffee ]; then
echo "pas de dossier coffee, on le crée"
mkdir coffee
fi
echo -e " copie du dossier ${bleuclair}${bold}${name}${normal} vers le dossier ${bold}coffee${normal} ${neutre}"
cp -R ${name}/* coffee
echo "lire les fichiers du dossier coffee"
# list files and exclude node modules
COUNTER=0
for FILE in `find coffee -name "*.js" -type f -o -path './node_modules' -prune -o -path './components' -prune`
do
if [ -e $FILE ] ; then
COFFEE=${FILE//\.js/\.coffee}
echo -e " converting ${FILE} to ${bleuclair}${COFFEE}${neutre}${normal}"
js2coffee "$FILE" > "$COFFEE"
rm $FILE
COUNTER=$((COUNTER+1))
else
echo "File: $1 does not exist!"
fi
done
echo -e "${bleuclair}${bold} $COUNTER ${normal}${neutre} fichiers convertis"
cd ../

10
bash/git/jasmine-pre-commit.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# A git pre-commit hook that verifies that the change does not introduce
# the use of a Jasmine exclusive test , which would
# prevent most other tests from being run without any clear indication thereof
FILES_PATTERN='\.(js|coffee)(\..+)?$'
FORBIDDEN='fit('
git diff --cached --name-only | \
grep -E $FILES_PATTERN | \
GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n $FORBIDDEN && echo 'COMMIT REJECTED Found "$FORBIDDEN" references. Please remove them before commiting' && exit 1

View File

@ -0,0 +1,50 @@
#!/bin/bash
#
# script pour faire du browsersync dans un projet symfony
# il doit être lancé depuis la racine du projet symfony
NORMAL="\\033[0;39m"
BLEU="\\033[1;34m"
CYAN="\\033[1;36m"
touch Gulpfile.js;
echo "Gulpifions votre application symfony2! Ce script doit être lancé depuis la racine du projet symfony";
SERVERNAME="symfony.dev";
NEWSERVERNAME=$SERVERNAME;
echo -e "$BLEU vous devez créer un virtualhost, choisissez son nom. \n faites entrée si ok, ou bien écrivez un autre nom $NORMAL";
read -p " ( $SERVERNAME ): " NEWSERVERNAME ;
echo -e "$BLEU copie des fichiers gulp configuré pour ce nom de serveur $NORMAL";
cp init/Gulpfile.js .
sed -i 's/myservername.dev/'$NEWSERVERNAME'/g' Gulpfile.js
NEWSERVERNAME=${NEWSERVERNAME:=$SERVERNAME}
echo -e "$BLEU nouveau serveur: $CYAN $NEWSERVERNAME $BLEU" ;
FOLDERSYMFONY=$(pwd);
read -p "modification du virtualhost, choisissez le dossier de votre projet ( $FOLDERSYMFONY ) " NEWFOLDERSYMFONY;
NEWFOLDERSYMFONY=${NEWFOLDERSYMFONY:=$FOLDERSYMFONY}
echo "replacing servername in config temp file"
cp init/virtualHostSymfony.conf init/tmpVirtualHostSymfony.conf
sed -i 's/myservername.dev/'$NEWSERVERNAME'/g' init/tmpVirtualHostSymfony.conf
echo -e "$BLEU virtual host: $CYAN $NEWSERVERNAME $BLEU" ;
VHOSTCONTENT=$(cat init/tmpVirtualHostSymfony.conf);
echo -e "$CYAN $VHOSTCONTENT $NORMAL";
echo -e "copying replaced config in sites-available"
sudo cp init/tmpVirtualHostSymfony.conf /etc/apache2/sites-available/$NEWSERVERNAME.conf ;
echo -e "$CYAN success $NORMAL";
ls -larth /etc/apache2/sites-available/ |grep $NEWSERVERNAME;
echo -e "$CYAN enabling new server $NEWSERVERNAME.conf $NORMAL"
sudo a2ensite $NEWSERVERNAME.conf ;
echo -e "$CYAN success $NORMAL";
echo -e "$BLEU restarting apache2 $NORMAL" ;
echo "restart apache2"
sudo service apache2 stop;
sudo service apache2 start;
echo -e "$BLEU installation des dépendances gulp dans package.json $NORMAL" ;
echo -e "$BLEU lancement du serveur gulp syncronisé $NORMAL" ;
npm i -D gulp browser-sync --save-dev;
echo -e "$CYAN ça c'est fait $NORMAL" ;
echo -e "$BLEU lancer gulp $NORMAL" ;
gulp

View File

@ -0,0 +1,28 @@
/**
gulpify script of tykayn
https://github.com/tykayn/blog.artlemoine.com
http://artlemoine.com
to run this you need bash to install dependencies:
npm i -D gulp browser-sync --save-dev;
gulp
**/
var serverName = 'myservername.dev'; // you NEED to have a vhost of this name setup
var gulp = require('gulp');
var browserSync = require('browser-sync');
// Static server.
gulp.task('browser-sync', function () {
// init server
browserSync.init({
proxy: serverName + "/app_dev.php"
});
// the server will automatically reload on change
var filesToWatch = ["**/*.twig",
"**/*.js",
"src/**/*.php"];
gulp.watch(filesToWatch)
.on('change', browserSync.reload);
});
gulp.task('default', ['browser-sync']);

View File

@ -0,0 +1,19 @@
# virtual host generated by the gulpify script of tykayn
# http://artlemoine.com
<VirtualHost *:80>
# for example
# ServerName testinglive.dev
ServerName meuh.lan
ServerAdmin webmaster@localhost
# /var/www/html/testinglive/web
DocumentRoot /var/www/html/testinglive/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html/testinglive/web">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
# this command has changed since apache 2.4
Require all granted
</Directory>
</VirtualHost>

View File

@ -0,0 +1,19 @@
# virtual host generated by the gulpify script of tykayn
# http://artlemoine.com
<VirtualHost *:80>
# for example
# ServerName testinglive.dev
ServerName myservername.dev
ServerAdmin webmaster@localhost
# /var/www/html/testinglive/web
DocumentRoot /var/www/html/testinglive/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html/testinglive/web">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
# this command has changed since apache 2.4
Require all granted
</Directory>
</VirtualHost>

24
bash/init-symfony2.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# script to init a symfony 2 project
php composer.phar install;
echo "now you need to grant access to database";
# copy template for parameters
cp app/config/parameters.yml.dist app/config/parameters.yml
cat app/config/parameters.yml
# build dedicated database in mysql
# test if database exists
# create database
# test for user
# create user
# ok mysql done
# update schema
php app/console doctrine:schema:update --force
# clear cache
php app/console cache:clear
# run server
php app/console server:run

10
bash/mastodon/README.md Executable file
View File

@ -0,0 +1,10 @@
#Script d'install de Mastodon sur Ubuntu 18.04
à lancer après une installation toute neuve d'ubuntu 18.04 server.
Cette install de Mastodon fonctionne avec Ruby, Nginx, NPM, yarn qui seront installés automatiquement si besoin
```bash
&& wget https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/mastodon/mastodon_install.sh \
&& chmod +x mastodon_install.sh
&& sudo bash mastodon_install.sh
```

View File

@ -0,0 +1 @@
# config nginx

View File

@ -0,0 +1,60 @@
#!/bin/bash
# version 1.0.0
# Script crée par Tykayn
# Copyleft 2018 Tykayn
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#code mise en forme
neutre='\e[0;m'
conseil='\e[1;32m' #vert
clear
# sudo!
if [ "$UID" -ne "0" ]
then
echo -e "Il faut etre root pour executer ce script. ==> ${conseil} sudo ./tykayn_postinstall.sh ${neutre}"
exit
fi
echo -e "**************************************************";
echo -e "";
echo -e "Ce script va installer Mastodon sur votre serveur.";
echo -e "";
echo -e "**************************************************";
read -p " Quel est le nom de domaine de votre site? ( www.exemple.com sans https:// devant) " domainName
read -p "${conseil} Installation pour ${domainName}, vous confirmez? [Yn]" -i "Y" confirmationAnswer
case $answer in
[yY]* )
echo "Okay, C'est parti pour ${domainName}"
break;;
[nN]* ) exit;;
* ) echo "Dude, just enter Y or N, please.";;
esac
echo -e "${conseil} TADAM! ça c'est fait ${neutre}"
echo "*******************************************************"
echo "Script fait par Tykayn - https://www.cipherbliss.com"
echo "Pour prendre en compte tous les changements, il faut maintenant redémarrer !"
read -p "Voulez-vous redémarrer immédiatement ? [o/N] " rep_reboot
if [ "$rep_reboot" = "o" ] || [ "$rep_reboot" = "O" ]
then
reboot
fi

11
bash/postinstall/README.md Executable file
View File

@ -0,0 +1,11 @@
#Script de PostInstall
à lancer après une installation toute neuve d'ubuntu 18.04 sur votre ordinateur portable.
```bash
mkdir script_postinstall \
&& cd script_postinstall \
&& wget https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/postinstall/tykayn_postinstall.sh \
&& chmod +x tykayn_postinstall.sh
&& sudo bash tykayn_postinstall.sh
```

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,152 @@
#!/bin/bash
# version 2.0.1
# Script crée par Tykayn
# Copyleft 2018 Tykayn
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#code mise en forme
neutre='\e[0;m'
conseil='\e[1;32m' #vert
clear
# sudo!
if [ "$UID" -ne "0" ]
then
echo -e "Il faut etre root pour executer ce script. ==> ${conseil} sudo ./tykayn_postinstall.sh ${neutre}"
exit
fi
# script appelé par le script post-install dans le cas du choix profil automatique (tykayn 16)
### Developement tools
echo -e "${conseil}Ce script va installer de quoi faire marcher des sites web localement, des logiciels de bureautique et de graphisme. enjoy! ${neutre}"
echo "*******************************************************"
# config de clavier
# TODO: FIX
# echo "keybaord config"
# mv /etc/default/keyboard /etc/default/keyboard_backup
# wget https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/postinstall/keyboard --directory-prefix=/etc/default
echo "dolphin config"
mv /etc/default/keyboard /etc/default/keyboard_backup
wget https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/postinstall/user_config/dolphinrc --directory-prefix=/home/$USER/.config/
echo "add aliases to user profile"
# https://frama.link/tk_setup is equivalent to
# https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/postinstall/tykayn_postinstall.sh
# wget https://frama.link/tk_setup --directory-prefix=/home/$USER
wget https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/aliases.sh --directory-prefix=/home/$USER
mv /home/$USER/aliases.sh /home/$USER/.bash_aliases
echo "update and upgrade packages"
apt update && apt upgrade
### main programs
apt install git nano zsh nodejs npm docker docker-compose virtualbox pidgin openvpn
npm i -g yarn @angular/cli
### install oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# LAMP server
# https://doc.ubuntu-fr.org/lamp#installation
apt install libapache2-mod-php mysql-server php-mysql php-curl php-gd php-intl php-json php-mbstring php-xml php-zip
# PHP related
# php extensions
#apache server
a2enmod rewrite
echo "installing composer"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
### Internet/Web
apt install firefox chromium-browser -y
#telegram
add-apt-repository ppa:atareao/telegram
apt update
apt install telegram -y
### Multimédia
apt install gnome-mpv vlc blender kdenlive -y
### Graphisme
apt install mypaint krita krita-l10n -y
apt purge gimp -y ; add-apt-repository -y ppa:otto-kesselgulasch/gimp ; apt update ; apt upgrade -y ; apt install gimp -y #gimp dernière version
### Outils
#Support système de fichier BTRFS
#Support système de fichier ExFat
#Support d'autres systèmes de fichier (f2fs, jfs, nilfs, reiserfs, udf, xfs, zfs)
apt install baobab grsync screen subdownloader handbrake audacity easytag screenfetch ncdu btrfs-tools exfat-utils exfat-fuse f2fs-tools jfsutils nilfs-tools reiser4progs reiserfsprogs udftools xfsprogs xfsdump zfsutils-linux zfs-initramfs -y
######## config clavier
#Gnome Shell : augmenter durée capture vidéo de 30s à 10min
su $SUDO_USER -c "gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 600"
#Optimisation grub : dernier OS booté comme choix par défaut
sed -ri 's/GRUB_DEFAULT=0/GRUB_DEFAULT="saved"/g' /etc/default/grub ; echo 'GRUB_SAVEDEFAULT="true"' >> /etc/default/grub
updade-grub
#Grub réduction temps d'attente + suppression test ram dans grub
sed -ri 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=2/g' /etc/default/grub ; mkdir /boot/old ; mv /boot/memtest86* /boot/old/
#Swapiness 95% +cache pressure 50
echo vm.swappiness=5 | tee /etc/sysctl.d/99-swappiness.conf ; sysctl -p /etc/sysctl.d/99-swappiness.conf### Bureautique
apt install libreoffice-style-breeze libreoffice-style-elementary libreoffice-style-human libreoffice-style-sifr libreoffice-style-tango libreoffice-templates hunspell-fr mythes-fr hyphen-fr openclipart-libreoffice-y
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | /usr/bin/debconf-set-selections | apt install ttf-mscorefonts-installer -y
#TLP pour économie d'énergie pour les pc portable.
wget https://gitlab.com/simbd/Scripts_Ubuntu/raw/master/EconomieEnergie_TLP_Bionic.sh ; chmod +x EconomieEnergie_TLP_Bionic.sh
./EconomieEnergie_TLP_Bionic.sh ; rm EconomieEnergie_TLP_Bionic.sh
#police d'écriture MS
#plugin correction grammalecte
wget https://www.dicollecte.org/grammalecte/oxt/Grammalecte-fr-v0.6.2.oxt && chown $SUDO_USER Grammalecte* && chmod +x Grammalecte* ; unopkg add --shared Grammalecte*.oxt && rm Grammalecte*.oxt ; chown -R $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config/libreoffice #grammalecte
apt install steam -y
#snaps
snap install nextcloud-client
#config mysql
mysql_secure_installation
#config git
git config --global credential.helper store
# Nettoyage fichiers/dossiers inutiles qui étaient utilisés par le script
rm *.zip ; rm *.tar.gz ; rm *.tar.xz ; rm *.deb ; cd .. && rm -rf /home/$SUDO_USER/script_postinstall
clear
# Maj/Nettoyage
apt update ; apt autoremove --purge -y ; apt clean ; cd .. ; clear
echo -e "${conseil} TADAM! ça c'est fait ${neutre}"
echo "*******************************************************"
echo "Script fait par Tykayn - https://www.cipherbliss.com"
echo "Pour prendre en compte tous les changements, il faut maintenant redémarrer !"
read -p "Voulez-vous redémarrer immédiatement ? [o/N] " rep_reboot
if [ "$rep_reboot" = "o" ] || [ "$rep_reboot" = "O" ]
then
reboot
fi

View File

@ -0,0 +1,51 @@
Height 1080=617
MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAwAAAAAAAADbAAACR/wCAAAAAvsAAAAWAGYAbwBsAGQAZQByAHMARABvAGMAawAAAAAA/////wAAAAoBAAAD+wAAABQAcABsAGEAYwBlAHMARABvAGMAawEAAAAiAAACRwAAAFoBAAADAAAAAQAAAAAAAAAA/AIAAAAB+wAAABAAaQBuAGYAbwBEAG8AYwBrAAAAAAD/////AAAACgEAAAMAAAADAAAAAAAAAAD8AQAAAAH7AAAAGAB0AGUAcgBtAGkAbgBhAGwARABvAGMAawAAAAAA/////wAAAAoBAAADAAADFQAAAkcAAAAEAAAABAAAAAgAAAAI/AAAAAEAAAACAAAAAQAAABYAbQBhAGkAbgBUAG8AbwBsAEIAYQByAQAAAAD/////AAAAAAAAAAA=
Width 1920=1009
[CompactMode]
FontWeight=50
PreviewSize=16
[DetailsMode]
FontWeight=50
IconSize=48
PreviewSize=22
[General]
GlobalViewProps=true
Version=200
ViewPropsTimestamp=2018,6,5,13,15,30
[IconsMode]
FontWeight=50
IconSize=32
PreviewSize=112
[KPropertiesDialog]
Height 1080=450
Width 1920=807
[MainWindow]
Height 1080=617
MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAwAAAAAAAADbAAACR/wCAAAAAvsAAAAWAGYAbwBsAGQAZQByAHMARABvAGMAawAAAAAA/////wAAAAoBAAAD+wAAABQAcABsAGEAYwBlAHMARABvAGMAawEAAAAiAAACRwAAAFoBAAADAAAAAQAAAAAAAAAA/AIAAAAB+wAAABAAaQBuAGYAbwBEAG8AYwBrAAAAAAD/////AAAACgEAAAMAAAADAAAAAAAAAAD8AQAAAAH7AAAAGAB0AGUAcgBtAGkAbgBhAGwARABvAGMAawAAAAAA/////wAAAAoBAAADAAADFQAAAkcAAAAEAAAABAAAAAgAAAAI/AAAAAEAAAACAAAAAQAAABYAbQBhAGkAbgBUAG8AbwBsAEIAYQByAQAAAAD/////AAAAAAAAAAA=
ToolBarsMovable=Disabled
Width 1920=1009
[MainWindow][Toolbar mainToolBar]
IconSize=16
[Open-with settings]
CompletionMode=1
History=konso
[PreviewSettings]
Plugins=directorythumbnail,imagethumbnail,jpegthumbnail,windowsimagethumbnail,svgthumbnail
[SettingsDialog]
Height 1080=493
Width 1920=667
[Toolbar mainToolBar]
IconSize=16

View File

@ -0,0 +1,11 @@
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="fr"
XKBVARIANT="latin9"
XKBOPTIONS=""
BACKSPACE="guess"

6
bash/prompt-color.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# titre du terminal personnalisé
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# prompt personnalisé fait avec http://bashrcgenerator.com/
export PS1="\[\033[38;5;214m\]\T\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;192m\]\u\[$(tput sgr0)\]\[\033[38;5;42m\]@\[$(tput sgr0)\]\[\033[38;5;84m\]\h\[$(tput sgr0)\]\[\033[38;5;70m\]:\[$(tput sgr0)\]\[\033[38;5;6m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"

149
php/sexisme-php/index.php Executable file
View File

@ -0,0 +1,149 @@
<?php
/****************************
* un humain de base
****************************/
class Human {
public $name;
public $gender;
private $status;
//définr le statut
public function setStatus( $newStatus ) {
$this->status = $newStatus;
}
// Afficher qui on est
public function whoAmI() {
echo '<br/><i> Je suis un humain ' . $this->gender . ' ' . $this->status . ' nommé ' . $this->name . '</i>';
}
}
/****************************
* un mâle humain
* Class Man
* /*****************************/
class Man extends Human {
public function __construct( $complete_name = "Bob" , $status = "puceau" ) {
$this->name = $complete_name;
$this->gender = "homme";
$this->setStatus( $status );
}
/**
* les hommes ne fuckent qu'avec les femmes
* nous allons donc restreindre ce paramètre
* @param Woman $femme
*/
public function fuck( Woman $femme ) {
/**
* si la femme fuckeé est une mère,
* alors l'homme est un mother fuckeur
*/
if ( $femme->isMother() ) {
$newMaleStatus = "mother fucker";
$femme->setStatus( 'impossible' );
}
else {
// on va dire que fucker fait tomber enceinte à tous les coups.
$femme->pregnant = true;
$femme->setStatus( 'comblée' );
$newMaleStatus = "viril";
}
$this->setStatus( $newMaleStatus );
echo '<i>' . $this->name . ' : OWIIII ma mignonne à la rose</i>';
echo '<i>' . $femme->name . ' : HOU! grand fou je suis toute retournée</i>';
}
}
/****************************
* une femelle humain
* Class Woman
***************************/
class Woman extends Human {
public $pregnant = false;
public function __construct( $complete_name = "Alice" , $status = "vierge" ) {
$this->name = $complete_name;
$this->gender = "femme";
$this->setStatus( $status );
}
// tester si la femme est enceinte
public function isMother() {
if ( $this->pregnant == true ) {
return true;
}
return false;
}
}
/***************************
* lancer le rendu visuel
**************************/
// c'est sale de mettre autant de echo à la suite
echo "
<!-- doctype html -->
<html>
<head>
<title>Adam et Eve</title>
<meta charset=UTF-8 />
<style>
.container{
margin: 0 auto;
width:60ch;
}
i{
margin: 0.5em 2em 0;
padding: 1em;
background: #ccc;
display: block;
}
i+i{
margin: 0 2em;
}
</style>
</head>
<body>
<div class='container'>";
echo "Bonjour Monde!";
echo "<br/>Vous connaissez la légende: au huitième jour, Dieu créa le Lundi.";
echo "<br/>Créons donc Adam le premier homme";
$adam = new Man( "Adam" );
echo "<br/>hop, c'est fait.";
echo "<br/>Allez Adam, dis nous tout.";
$adam->whoAmI();
echo "<br/>Merci mon petit.";
echo "<br/>Créons donc Eve la première femme";
$eve = new Woman( "Eve" );
echo "<br/>hop, c'est fait.";
echo "<br/>Allez Eve, dis nous tout.";
$eve->whoAmI();
echo "<br/>Merci mon petit.";
echo "<br/>Et puis un jour, Adam et Eve ont forniqué.";
echo "<br/>Ici c'est donc Adam qui prend Eve.";
$adam->fuck( $eve );
echo "<br/>hop, c'est fait.";
echo "<br/>Eve est donc comblée et enceinte.";
$eve->whoAmI();
echo "<br/>Et adam a gagné en virilité.";
$adam->whoAmI();
echo "<br/>Mais adam, fort de pulsions animales absolument incontrôlables
ne s'arrête pas et va fucker Eve qui est maintenant une maman.
Hors nous savons que les maman sont dénuées d'activité sexuelle";
$adam->fuck( $eve );
echo "<br/>Eve est donc une femme qui ne peut exister.";
$eve->whoAmI();
echo "<br/>Et Adam a gagné un nouveau statut.";
$adam->whoAmI();
echo "</div>
</body>
</html>
";

View File

@ -0,0 +1,21 @@
{% extends "::index.html.twig" %}
{% block main %}
<div class="well">
{% verbatim %}
<div ng-app='tk'>
<div ng-controller='mainCtrl'>
test: {{test}}
</div>
</div>
{% endverbatim %}
<script type="text/javascript"
src="{{ asset('bundles/tykaynportfolio/js/angular/lib/angular/angular.js') }}"></script>
<script type="text/javascript">
angular.module("tk", ['tk.controllers']);
angular.module("tk.controllers", []).controller('mainCtrl', ['$scope', function ($scope) {
$scope.test = 20;
}]);
</script>
</div>
{% endblock %}