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
Open the /etc/systemd/logind.conf file in a text editor as root, for example, | |
sudo -H gedit /etc/systemd/logind.conf | |
Add a line HandleLidSwitch=ignore (make sure it's not commented out!), | |
Restart the systemd daemon with this command: | |
sudo restart systemd-logind |
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 | |
for filename in `ls -1 | grep -E .mp4$\|.wmv$\|.ogv$`; do | |
ext="${filename##*.}" | |
name="${filename%.*}" | |
mv "${name}.${ext}" "${name}_v1.${ext}" | |
done |
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
# Check that your MongoDB Server and your MongoDB Client are the same. | |
# MongoDB Server (daemon mongod) | |
$ mongod --version | |
# Or mongo then : | |
# > db.version() | |
# or | |
# > db.serverStatus().version | |
# MongoDB Client (processus mongo, your MongoDB Shell) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Page Title</title> | |
<meta name="description" content="Ma description" /> | |
<!-- -CSS --> | |
<link rel="stylesheet" href="file.css"> | |
<style type="text/css"> | |
p { |
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
#!/usr/bin/env bash | |
rows=$1 | |
columns=$2 | |
pdfname=$3 | |
# There are ${rows}x${columns} slides per pdf page. | |
# Create a new pdf file <name>-nub.pdf in the current folder for pdfname=<name>.pdf | |
pdfnup --no-landscape --a4paper --nup ${columns}x${rows} ${pdfname} |
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
#!/usr/bin/env bash | |
# | |
# compress-img.bash | |
# | |
# Reduce size by 50% for each given image by copying that in | |
# a new folder ./compressed. | |
# | |
# You can reduce size or quality of each image, if you don't want, | |
# send a link to application where there are your images. And this | |
# script is usless for your use case. |
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
#!/usr/bin/env python3 | |
"""Insert LaTex equation (for https://stackoverflow.com/) | |
Add LaTex equation under the shape of PNG image to your stackoverflow post. | |
Print text to add to your post, and download the image equation if necessary. | |
(use https://chart.googleapis.com). | |
See help with -h and --help option for more details. |
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
#!/usr/bin/env bash | |
# | |
# reset-filesystem-permission.bash | |
# | |
# Reset permission of current directory only files, subfolders and current folder | |
# from umask. | |
# | |
# /!\ This action can be hard to reverse, please use that with precaution. | |
# Change files permission |
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
#!/usr/bin/env bash | |
usage() { | |
cat << EOF | |
usage: `basename "$0"` jar_name [file_name] | |
See content of archive jar, then content of a file if precised. | |
EOF | |
exit 1 | |
} |
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
#!/usr/bin/env bash | |
# | |
# pdf-to-booklet.bash | |
# | |
# Convert document pdf with A4 format as a booklet with A5 format. | |
# A output/ folder will be created in the current directory containing: | |
# - input.pdf : original modified pdf document (with blank pages, to have a | |
# number of pages which is a multiple of 4). | |
# - output.pdf : booklet | |
# |
OlderNewer