Skip to content

Instantly share code, notes, and snippets.

UltimateByte UltimateByte

  • HaiSoftSARL
  • France
Block or report user

Report or block UltimateByte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@UltimateByte
UltimateByte / 1) debian_change_hostname
Last active Jun 3, 2019
How to create a proper debian LAMP server
View 1) debian_change_hostname
# Hostname
hostname
hostname -f
nano /etc/hostname
nano /etc/hosts
shutdown -r now
hostname
hostname -f
@UltimateByte
UltimateByte / Debian Basics
Created Jun 3, 2019
Debian first things after install
View Debian Basics
# Update the system
apt update && apt upgrade
# Add 32 bit architecture support (game servers)
dpkg --add-architecture i386 && apt update
# Install basic packages
apt install nano wget zip unzip bzip2 linux-kernel-headers tmux ca-certificates curl locales
# Reminder: sources for apt are in: /etc/apt/sources.list
# Chaning hostname
hostname #insernamehere
View Swap cheatsheet
# Swap strengh (between 0-100) > Lowest value == less swap
sysctl vm.swappiness=X
# Permanently store this value
/etc/sysctl.conf
# Disable Swap
swapoff -a
# Enable Swap
View filesgen.sh
#!/bin/bash
# Settings
subdir="manyiles"
echo "Starting"
echo "How many files do you wanna generate ?"
read -r amount
View permissions&ownerships
# Permissions
Change permissions for user, groups, and others on files and directories.
## Command
chmod
## Syntax
chmod -destination+-permissions /path/to/dir/or/file
### Recursive argument
@UltimateByte
UltimateByte / debian_basic_packages
Last active Jan 16, 2017
First things to do in debian
View debian_basic_packages
apt-get update && apt-get upgrade
dpkg --add-architecture i386 && apt-get update
apt-get install nano wget zip unzip bzip2 linux-kernel-headers tmux ca-certificates curl locales
# sources in /etc/apt/sources.list
View debian_ftp
# First off, you'd better use SFTP that comes with the SSH protocol on default port 22.
# > Nothing to configure to get it working as long as you got an SSH server.
# If you wish to install an FTP server anyways, then:
# Uninstall any other FTP
apt-get remove --purge your_previous_ftp_server
# Update your package list and programs and install proftpd
apt-get update && apt-get upgrade
apt-get install proftpd
View website_files_ownership
# This is targetted towards people using a user for each website.
# Give back its own files to your user
chown -R user:user ~user/public_html
# Copy user permissions to group permissions
chmod -R g=u ~user/public_html
# Disallow other users from everything on your files
chmod -R o-rwx ~user/public_html
View wordpress_deployment
# According to my tutorial, make sure you got a dedicated user for the website
adduser username
# Getting Wordpress
cd /home/username/public_html
wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
rm latest.tar.gz
mv wordpress/* .
rm -R wordpress
You can’t perform that action at this time.