The above animation can be generated on the termnal using the following script.
Pages
▼
Create animated 2019 on terminal
The above animation can be generated on the termnal using the following script.
Making the changes in resolv.conf permanent
The previous post we modified resolv.conf to get the internet connectivity back. The problem with the solution is that the resolv.conf file gets overwritten on every boot. To make the changed dns name server permanent we the need to update the file
/etc/network/interfaces
auto lo
iface lo inet loopback
Update the contents of the file above with the line
dns-nameservers 8.8.8.8
Save the file and restart the networking
/etc/init.d/networking restart
On the next reboot you should see the dns server nadded to the file resolv.conf.
Update the contents of the file above with the line
Save the file and restart the networking
On the next reboot you should see the dns server nadded to the file resolv.conf.
wifi connected but No interent in ubuntu 18.04 after upgrade
After upgrade to ubutnu 18.04, the intenet connections both wired and wireless showed that they were connected but the internet was not working.
The issue turned to be wrong DNS server in /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53
In the above resolv.conf file add the line
nameserver 8.8.8.8
To change the resolv.conf open the file /etc/resolv.conf as root and add the abov line. Save the file and restart networking using
/etc/init.d/networking restart
The issue turned to be wrong DNS server in /etc/resolv.conf
In the above resolv.conf file add the line
To change the resolv.conf open the file /etc/resolv.conf as root and add the abov line. Save the file and restart networking using
unable to launch vmplayer 14
After installing vmplayer 14 in ubuntu 18.04 player might fail to launch with vmmon modules failing to compile with errors
vmmon struct timer_list has no member named data
and
vmmon implicit declaration of function global_page_state
To get around these errors we will need to modify the code of vmmon as given in https://github.com/mkubecek/vmware-host-modules/commit/562121d7bc06 and https://github.com/mkubecek/vmware-host-modules/commit/770c7ffe611520ac96490d235399554c64e87d9f To do the above mentioend changes, you can follow the following steps. Go to the folder
/usr/lib/vmware/modules/source
Untar the folder vmmon.tar
tar -xvf vmmon.tar
This will create a folder vmmon-only which will contain the code for the module vmmon.Now we can follow the changes mentioned in the above two links in the respective files.
After doing the changes recreate the vmmon.tar using the following command
tar -cvf vmmon.tar vmmon-only
Now we should be able to launch vmplayer and the modules should get compiled successfully.
and
To get around these errors we will need to modify the code of vmmon as given in https://github.com/mkubecek/vmware-host-modules/commit/562121d7bc06 and https://github.com/mkubecek/vmware-host-modules/commit/770c7ffe611520ac96490d235399554c64e87d9f To do the above mentioend changes, you can follow the following steps. Go to the folder
Untar the folder vmmon.tar
This will create a folder vmmon-only which will contain the code for the module vmmon.Now we can follow the changes mentioned in the above two links in the respective files.
After doing the changes recreate the vmmon.tar using the following command
Now we should be able to launch vmplayer and the modules should get compiled successfully.
Basic Char driver for kernel version 4.15.0
In the post, Example Char driver, the code for a basic charchater driver is given along with the steps to insert it into the kernel and create a char device.
#include
#include
#include // required for various structures related to files liked fops.
#include // required for copy_from and copy_to user functions
#include
#include
static int Major;
dev_t dev_no,dev;
struct device1 {
char array[100];
struct semaphore sem;
}char_arr;
int open(struct inode *inode, struct file *filp)
{
printk(KERN_INFO "Inside open \n");
if(down_interruptible(&char_arr.sem)) {
printk(KERN_INFO " could not hold semaphore");
return -1;
}
return 0;
}
int release(struct inode *inode, struct file *filp) {
printk (KERN_INFO "Inside close \n");
printk(KERN_INFO "Releasing semaphore");
up(&char_arr.sem);
return 0;
}
ssize_t read(struct file *filp, char *buff, size_t count, loff_t *offp) {
unsigned long ret;
printk("Inside read \n");
ret = copy_to_user(buff, char_arr.array, count);
return ret;
}
ssize_t write(struct file *filp, const char *buff, size_t count, loff_t *offp) {
unsigned long ret;
printk(KERN_INFO "Inside write \n");
ret = copy_from_user(char_arr.array, buff, count);
return count;
}
struct file_operations fops = {
read: read,
write: write,
open: open,
release: release
};
struct cdev *kernel_cdev;
int char_arr_init (void) {
int ret;
kernel_cdev = cdev_alloc();
kernel_cdev->ops = &fops;
kernel_cdev->owner = THIS_MODULE;
printk (" Inside init module\n");
ret = alloc_chrdev_region( &dev_no , 0, 1,"chr_arr_dev");
if (ret < 0) {
printk("Major number allocation is failed\n");
return ret;
}
Major = MAJOR(dev_no);
dev = MKDEV(Major,0);
sema_init(&char_arr.sem,1);
printk (" The major number for your device1 is %d\n", Major);
ret = cdev_add( kernel_cdev,dev,1);
if(ret < 0 )
{
printk(KERN_INFO "Unable to allocate cdev");
return ret;
}
return 0;
}
void char_arr_cleanup(void) {
printk(KERN_INFO " Inside cleanup_module\n");
cdev_del(kernel_cdev);
unregister_chrdev_region(Major, 1);
}
MODULE_LICENSE("GPL");
module_init(char_arr_init);
module_exit(char_arr_cleanup);
The following is the updated code for the same driver tested for the kernel version 4.15.0.To test the working of the driver please use the code given in post User access for example driver
tar Cannot stat: No such file or directory
tar is a command used to create an archive for the folder to combine the contents of a folder into one archive.
If we want to create an archive for the folder named xyz, as xyz.tar , running the command as
shown below will throw an error
tar -cfv xyz.tar
"Cannot stat: No such file or directory".
The problem is because of the wrong sequence of options being passed to the tar command. To get around the error the sequence of options to be passed is as below.
tar -cvf xyz.tar xyz
The above command will run with out errors and it should be able to create xyz.tar.
The problem is because of the wrong sequence of options being passed to the tar command. To get around the error the sequence of options to be passed is as below.
The above command will run with out errors and it should be able to create xyz.tar.