Google translate through command line

Install gawk and wget if needed

sudo apt-get install gawk wget -y

Install translate cli

wget https://github.com/soimort/google-translate-cli/archive/master.tar.gz
tar -xvf master.tar.gz
cd google-translate-cli-master/
sudo make install
Usage

trs {en=ru+es} "Some text here"

Часть текста здесь
Parte del texto aquí

Google translater 🙂

Enjoy!… Read the rest

How to mount /tmp folder as separate filesystem

Backup your

cp -rp /etc/fstab /etc/fstab_old

1. Create 1GB tmpmnt partition file

cd /var
dd if=/dev/zero of=tmpMnt bs=1024 count=1048576

2. Format new partition

mkfs.ext3 -j /var/tmpMnt
Press Y when asked

3. Backup old /tmp

cp -rp /tmp /tmp_old

4. Mount the new /tmp filesystem

mount -o loop,noexec,nosuid,rw /var/tmpMnt /tmp

5.… Read the rest

Disable mysql password authentification

Reset mysql password

/usr/bin/mysqladmin -u root password 'new-password'

Add the following lines to your /root/.my.cnf file

vi /root/.my.cnf

[mysqladmin]
user=root
password=new-password

[client]
user=root
password=new-password

Update permissions to 0600

chmod 600 /root/.my.cnf

Restart your mysql server

service mysqld restartRead the rest

Xubuntu /etc/resolv.conf file resets after reboot

To add your nameserver either add the following line to your /etc/network/interfaces file

sudo vi /etc/network/interfaces

dns-nameservers 8.8.8.8, 8.8.4.4

or update the following file with content that you want to see in /etc/resolv.conf file

sudo vi /etc/resolvconf/resolv.conf.d/base

nameserver 8.8.8.8
nameserver 8.8.4.4

Than run next command to update /etc/resolv.conf… Read the rest

Xubuntu can’t set up custom network settings via /etc/network/interfaces file

To fix remove network-manager

 sudo apt-get remove network-manager wicd -y

and set up your settings into 'interfaces' file

sudo vi /etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet static
address 10.0.0.137
netmask 255.255.255.0
gateway 10.0.0.2
auto eth0

Don't forget about /etc/resolv.conf… Read the rest

How to add new WordPress administrator user via mysql command line

Backup firstly your database using mysqldump command

mysqldump your_database > your_database.sql

mysql>

INSERT INTO `your_database`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`) VALUES ('1000', 'newadminuser', MD5('55new_strong!_!p@ssword55'), 'newadminuser', '[email protected]', '0', 'Admin User');

 

 

INSERT INTO `your_database`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1000', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

 

 

INSERT INTO `your_database`.`wp_usermeta`

Read the rest

Starting work of Firefox via SSH tunnel

Check you WAN IP address

http://ip.alltime.pp.ua/

Run in terminal

ssh -D 2020 -C [email protected]

Go to Firefox –> Edit –> Preferences –> Advanced tab –> Network tab –> Settings button.

Select "Manual proxy configuration"

All fields are empty except:

SOCKS Host: localhost Port: 2020
SOCKS v5
No Proxy for: localhost, 127.0.0.1

Check you WAN IP address now

http://ip.alltime.pp.ua/
Read the rest