No matter for what reason ,we as admin sometimes want to simulate memory usage . There have many ways to do this ,below one is to use shell command ,so we don’t need additional tools or code by specific program language.
yes |tr \\n a |head -c $((1024*1024*100)) | grep x
Above command will create 100M memory usage . 1024*1024 means M , and 1024*1024*1024 means G , you can specify what you want
In case you want to simulate use up all physical memory you can specify a number which is bigger than your total physical memory.
If you wan to let this occurs for period , you can try below command.
cat <(yes |tr \\n a |head -c $((1024*1024*1024*2)) ) <(sleep 100) |grep x
This command will simulate occupying 2G physical memory for 100 seconds.
We can use below command to generate cpu loading in linux
yes > /dev/null &
“yes” is a command to print “yes” to screen repeatedly
/dev/null is data sink ,which means the output of command “yes” will be discareded
“&” means let this command to be running in background
One above command will use up one cpu core (or Hyper Thread)
You can use command “cat /proc/cpuinfo” to check how many cpus you have, eg: if you have 4 cpus (probably 1 cpu with 2 cores and each core have 2 threads) , then you need to run 4 above command to make your cpu 100% busy
In Ubuntu 18.04 , the Show Application icon is at the bottom of the Dock.If you have Windows experience you may feel better if it locates on the top but not bottom to make Ubuntu much like Windows
To move the Show Application icon to top , the simplest way is to use gsettings command . Maybe you hate command line ,but that what Ubuntu is , you need to install another tool or application without using command line.
Right-click your Ubuntu desktop then click Open Terminal (Or by pressing Ctl+Alt+t) , then input below command and press Enter , it’s done ,so simple.
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true
If you want to revert it back ,just issue below command
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top false
1.First we need to enable or set root password using below command,you can open a terminal via Ctl+Alt+t
2.To allow root login gui ,we need to modify /etc/pam.d/gdm-password to uncomment below line .(Add a “#” to the beginning of the line)
#auth required pam_succeed_if.so user != root quiet_success
3.We still need to modify /root/.profile as below , or there maybe an error prompted when you login using root account.Just as the image below you need to uncomment line “mesg n || true” and replace it with 3 lines as showed
1.(Optional) If it’s the only user account whose name you want to change , you need to enable root account in case something wrong and cause both new and old account can not login. To enable root account ,just open an terminal by pressing Ctl+Alt+t,then issue below to commands to set a password for root
2.Logout the user account whose name you need to change
3.Press Ctl+Alt+F3(or F4 F5 F6) to switch to virtual console and login with root (Of course if you have another user account with admin access ,you can login gui with that account )