ubuntu +crontab+grub
for upgrade error subprocess
try this first
sudo apt-get remove linux-image-3.xxx-generic
if not work try this
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists/* sudo rm /var/cache/apt/*.bin sudo apt-get clean sudo apt-get autoremove sudo apt-get update sudo dpkg --configure -a sudo apt-get install -f
if still getting same error then try
sudo dpkg --remove --force-remove-reinstreq package_name
after removing package update your system and restart once
if boot option menu disappear
sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install -y boot-repair && (boot-repair &)
if boot partition full
sudo apt-get autoremove
speedup ubuntu
sudo apt-get install linux-firmware-nonfree
Click on the grey Ubuntu logo (Dash home). Query:software
Click on Software & Updates - tab Additional Drivers.
sudo apt-get install synaptic dconf-tools gksu gdebi lxkeymap inxi leafpad
cat /proc/sys/vm/swappiness
changevalue 60 to 10
gksudo leafpad /etc/sysctl.conf
add line
# Decrease swap usage to a more reasonable level
vm.swappiness=10
restart
cat /proc/sys/vm/swappiness
1 GB RAM or more: swappiness at 10
Less than 1 GB RAM: swappiness at 5
install youtube-dl
wget: sudo wget https://yt-dl.org/downloads/2014.09.25/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+x /usr/local/bin/youtube-dl sudo youtube-dl -U
$ sudo apt-get install python-pip python-dev build-essential $ sudo pip install --upgrade pip $ sudo pip install --upgrade virtualenv sudo pip install --upgrade youtube-dl
install ffmpeg in ubuntu 14.04
sudo add-apt-repository ppa:mc3man/trusty-media sudo apt-get update sudo apt-get install ffmpeg gstreamer0.10-ffmpeg
//sudo add-apt-repository ppa:jon-severinsson/ffmpeg
//sudo apt-get update //sudo apt-get install ffmpeg //sudo apt-get install frei0r-plugins
convert mp4 to mp3
sudo add-apt-repository ppa:ffmulticonverter/stable sudo apt-get update sudo apt-get install ffmulticonverter
sudo apt-get install format junkie
edit grub boot order
sudo gedit /etc/default/grub
and edit GRUB_DEFAULT=0
install flash
sudo apt-get install ubuntu-restricted-extras
install flash on ubuntu 14.04 64 bit
sudo apt-get install pepperflashplugin-nonfree sudo update-pepperflashplugin-nonfree --install
menu bar time disappear
Try reseting its configuration
dconf reset -f /com/canonical/indicator/datetime/
If it didn't show up try kill it, it should restart
pkill -f datetime
switch language in ubuntu 13.10
sudo add-apt-repository ppa:attente/modifier-only-input-switch sudo apt-get update sudo apt-get upgrade
sudo add-apt-repository ppa:attente/1218322
sudo apt-get update
sudo apt-get upgrade
Install font thai on ubuntu
1. ใช้คำสั่ง sudo apt-get update เพื่ออัปเดต packages
2. ใช้คำสั่ง sudo apt-get install ttf-thai-tlwg xfonts-thai xfonts-thai-etl xfonts-thai-manop xfonts-thai-nectec xfonts-thai-poonlap xfonts-thai-vor เพื่อติดตั้ง font thai ที่มีคนคิดขึ้นมา
3. ใช้คำสั่ง sudo apt-get install msttcorefonts เพื่อติดตั้ง font ของไมโครซอฟต์
หากเป็นฟอนต์ที่มีคนสร้างขึ้นมาเองในรูปแบบไฟล์ *.ttf มีขั้นตอนดังนี้
1. สร้างไดเรกทอรี ~/.fonts แล้วคัดลอกไฟล์ *.ttf มาไว้ในไดเรกทอรีนี้
2. แก้ไขไฟล์ ~/.fonts.conf โดยให้มีการ match ของฟอนต์ เช่น
3. รันคำสั่ง fc-cache -f -v
crontab
Crontab file consists of command per line and have six fields actually and separated either of space or tab. The beginning five fields represent time to run tasks and last field is for command.
Minute (hold values between 0-59)
Hour (hold values between 0-23)
Day of Month (hold values between 1-31)
Month of the year (hold values between 1-12 or Jan-Dec, you can use first three letters of each month’s name i.e Jan or Jun.)
Day of week (hold values between 0-6 or Sun-Sat, Here also you can use first three letters of each day’s name i.e Sun or Wed. )
Command
1. List Crontab Entries
List or manage the task with crontab command with -l option for current user.
# crontab -l 00 10 * * * /bin/ls >/ls.txt
2. Edit Crontab Entries
To edit crontab entry, use -e option as shown below. In the below example will open schedule jobs in VI editor. Make a necessary changes and quit pressing :wq keys which saves the setting automatically.
# crontab -e
3. List Scheduled Cron Jobs
To list scheduled jobs of a particular user called tecmint using option as -u (User) and -l (List).
# crontab -u tecmint -l no crontab for tecmint
Note: Only root user have complete privileges to see other users crontab entry. Normal user can’t view it others.
4. Remove Crontab Entry
Caution: Crontab with -r parameter will remove complete scheduled jobs without confirmation from crontab. Use -i option before deleting user’s crontab.
# crontab -r
5. Prompt Before Deleting Crontab
crontab with -i option will prompt you confirmation from user before deleting user’s crontab.
# crontab -i -r crontab: really delete root's crontab?
6. Allowed special character (*, -, /, ?, #)
Asterik(*) – Match all values in the field or any possible value.
Hyphen(-) – To define range.
Slash (/) – 1st field /10 meaning every ten minute or increment of range.
Comma (,) – To separate items.
7. System Wide Cron Schedule
System administrator can use predefine cron directory as shown below.
/etc/cron.d
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
8. Schedule a Jobs for Specific Time
The below jobs delete empty files and directory from /tmp at 12:30 am daily. You need to mention user name to perform crontab command. In below example root user is performing cron job.
# crontab -e 30 0 * * * root find /tmp -type f -empty -delete
9. Special Strings for Common Schedule
Need to replace five fields of cron command with keyword if you want to use the same.
10. Multiple Commands with Double amper-sand(&&)
In below example command1 and command2 run daily.
# crontab -e @daily <command1> && <command2>
11. Disable Email Notification.
By default cron send mail to user account executing cronjob. If you want to disable it add your cron job similar to below example. Using >/dev/null 2>&1 option at the end of the file will redirect all the output of the cron results under /dev/null.
[root@tecmint ~]# crontab -e * * * * * >/dev/null 2>&1
conclusion: Automation of tasks may help us to perform our task better ways, error free and efficiently. You may refer manual page of crontab for more information typing ‘man crontab‘ command in your terminal.