This file contains hidden or 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 | |
if test -d /etc/httpd/conf/sites-available && test -d /etc/httpd/conf/sites-enabled ; then | |
echo "-------------------------------" | |
else | |
mkdir /etc/httpd/conf/sites-available | |
mkdir /etc/httpd/conf/sites-enabled | |
fi | |
avail=/etc/httpd/conf/sites-available/$1.conf | |
enabled=/etc/httpd/conf/sites-enabled |
This file contains hidden or 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 | |
avail=/etc/httpd/conf/sites-enabled/$1.conf | |
enabled=/etc/httpd/conf/sites-enabled | |
site=`ls /etc/httpd/conf/sites-enabled` | |
if [ "$#" != "1" ]; then | |
echo "Use script: n2dissite virtual_site" | |
echo -e "\nAvailable virtual hosts: \n$site" | |
exit 0 | |
else |
This file contains hidden or 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 | |
sourcedir="$HOME/.local/src/" | |
mkdir "$sourcedir" | |
export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' | |
export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' | |
function install-dependencies() { | |
# Install build tools and Mesa VDPAU support. | |
sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \ | |
libvdpau-va-gl1 |
This file contains hidden or 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 | |
export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' | |
export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' | |
sourcedir="$HOME/.local/src" | |
mkdir "$sourcedir" | |
function git-clone() { | |
target="${sourcedir}/$1" | |
git clone "https://github.com/geany/$1" "$target" | |
cd "$target" |
This file contains hidden or 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
address=/fr.a2dfp.net/0.0.0.0 | |
address=/m.fr.a2dfp.net/0.0.0.0 | |
address=/mfr.a2dfp.net/0.0.0.0 | |
address=/ad.a8.net/0.0.0.0 | |
address=/asy.a8ww.net/0.0.0.0 | |
address=/static.a-ads.com/0.0.0.0 | |
address=/atlas.aamedia.ro/0.0.0.0 | |
address=/abcstats.com/0.0.0.0 | |
address=/ad4.abradio.cz/0.0.0.0 | |
address=/a.abv.bg/0.0.0.0 |
This file contains hidden or 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
# USE FLAGS | |
CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" | |
CODECS="aac cdda cdio cdparanoia cdr clang css djvu dvd dvdr enca exif ffmpeg flac gif gstreamer jpeg libass libburn libguess libsamplerate libsoxr matroska mp3 mp4 png postproc postscript ogg opus rubberband srt svg theora tiff vpx webp vorbis xattr x264 x265" | |
HARDWARE="acpi alsa apm fat llvm openal openmp sharedmem smp soap sockets socks5 sound tcmalloc threads udisks upnp upnp-av usb wifi xkb" | |
GRAPHICS="d3d9 dri drm egl opengl openmax s3tc wayland vaapi vdpau gles gles2" | |
COMPRESSION="bzip2 gzip lz4 lzma lzo rar snappy zip zlib" | |
DISABLE="-qt4 -qt5 -kde -consolekit -cups -ldap" | |
GNOME="gnome gnome-keyring gnome-online-accounts gtk gtk3 libnotify nautilus networkmanager pulseaudio" | |
USE="X ${CPU_FLAGS_X86} ${HARDWARE} ${GRAPHICS} ${CODECS} ${COMPRESSION} ${GNOME} ${DISABLE} bash-completion bindist branding crypt curl curlwrappers dbus fftw fontconfig ftp icu gimp git infinality libsecret mime mmap mozilla mtp ncurses n |
This file contains hidden or 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
Private + Shared = RAM used Program | |
224.0 KiB + 29.0 KiB = 253.0 KiB acpid | |
188.0 KiB + 75.0 KiB = 263.0 KiB ondemand | |
180.0 KiB + 95.0 KiB = 275.0 KiB sleep (2) | |
228.0 KiB + 63.0 KiB = 291.0 KiB atd | |
272.0 KiB + 41.5 KiB = 313.5 KiB agetty | |
200.0 KiB + 139.0 KiB = 339.0 KiB sh (2) | |
292.0 KiB + 77.0 KiB = 369.0 KiB ureadahead | |
352.0 KiB + 45.5 KiB = 397.5 KiB irqbalance |
This file contains hidden or 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
/// A trait that adds the ability for numbers to find their digit count and to convert them to padded strings. | |
trait Digits { | |
/// Counts the number of digits in a number. **Example:** {{0 = 0}, {1 = 1}, {10 = 2}, {100 = 3}} | |
fn digits(&self) -> usize; | |
/// Converts a number into a padded String, using `pad` as the character to pad with and `limit` as the size. | |
fn to_padded_string(&self, pad: char, limit: usize) -> String; | |
} | |
impl Digits for usize { |
This file contains hidden or 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
use std::fs; | |
use std::io::Read; | |
/// Obtains a list of video extensions from the `/etc/mime.types` file on Linux. | |
pub fn get_video_extensions() -> Result<Vec<String>, &'static str> { | |
fs::File::open("/etc/mime.types").ok() | |
// Return an error if /etc/mime.types could not be found. | |
.map_or(Err("tv-renamer: unable to open /etc/mime.types"), |mut file| { | |
// Create a buffer with the capacity of the file | |
let mut contents = String::with_capacity(file.metadata().map(|x| x.len()).unwrap_or(0) as usize); |
This file contains hidden or 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
/// Collects a list of all of the episodes in a given directory. Files that are not videos are ignored. | |
pub fn get_episodes(directory: &str) -> Result<Vec<PathBuf>, &str> { | |
fs::read_dir(directory).ok().map_or(Err("tv-renamer: unable to read file"), |files| { | |
let video_extensions = try!(mimetypes::get_video_extensions()); | |
let mut episodes = Vec::new(); | |
for entry in files { | |
let status = entry.ok().map_or(Some("tv-renamer: unable to get file entry"), |entry| { | |
entry.metadata().ok().map_or(Some("tv-renamer: unable to get metadata"), |metadata| { | |
if metadata.is_file() { | |
for extension in &video_extensions { |