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
| useradd sftp_user | |
| passwd sftp_user | |
| ################################################################################################################# | |
| # VERY IMPORTANT: all the elements in /path/to/chroot_folder must be owned by root with at most 755 permissions # | |
| ################################################################################################################# | |
| echo ''' | |
| Match User sftp_user | |
| X11Forwarding no | |
| AllowTcpForwarding no |
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
| # pickle save and load | |
| import pickle | |
| pickle.dump(obj, open(file, 'wb')) | |
| obj = pickle.load(open(file, 'rb')) | |
| # datetime tasks | |
| import datetime | |
| datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') | |
| # get execution time |
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
| # install vmware tools | |
| yum install -y open-vm-tools |
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
| reboot # if no free sector error occurs | |
| fdisk -l | |
| fdisk /dev/sda | |
| # type n -> p -> 3 | |
| # type t -> 3 -> 8e | |
| # type w | |
| reboot | |
| pvcreate /dev/sda3 | |
| vgdisplay | |
| vg_name='centos' |
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
| Stack( | |
| children: <Widget>[ | |
| Column( | |
| children: <Widget>[ | |
| Container(), | |
| Container(), | |
| ], | |
| ), | |
| _overlay(True) | |
| ], |
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
| # enable hibernate | |
| Powercfg /h on | |
| # disable hibernate | |
| Powercfg /h off | |
| # specifiy hibernation file size as percentage of total RAM (between 50 and 100) | |
| Powercfg /h /size nn | |
| # view hibernation file size |
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
| adb devices | |
| adb -s 15a5e8fc(deviceId) tcpip 5555 | |
| adb connect 192.168.0.100:5555 | |
| adb devices | |
| adb -s LGLS992a4b7c95d tcpip 5555 | |
| adb connect 192.168.0.157:5555 |
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
| su - postgres | |
| psql | |
| # change user password | |
| ALTER USER user_name WITH PASSWORD 'new_password'; | |
| \l #list databases | |
| \c db_name # use database | |
| \dt # list tables |
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
| var table_selector = '#table_id'; | |
| var i = 0; | |
| var content_length = 15; | |
| document.querySelectorAll(table_selector + ' tr').forEach((row, i) => { | |
| row.querySelectorAll('td').forEach((td, j) => { | |
| td.innerHTML = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, content_length); | |
| }); | |
| }); |
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
| # random between 10 and 5 | |
| select FLOOR(RAND()*(10-5+1)+5) |