https://www.digitalocean.com/community/tutorials/how-to-install-anaconda-on-ubuntu-18-04-quickstart
Sunday, September 19, 2021
Wednesday, August 11, 2021
Root file system requires manual fsck
From there, you should be able to drop to some maintenance shell (if not already opened), where you may run fsck -yf /dev/sda1
.
If there are any errors rerun fsck -yf /dev/sda1
To login as usual simply run exit
and proceed normally.
Thursday, June 3, 2021
Wednesday, May 19, 2021
create external table with data in csv
name string,
age int)
COMMENT 'Example table'
ROW FORMAT DELIMITED
FILEDS TERMINATED BY ','
SOTRED AS TEXTFILE
LOCATION '/data/warehouse/employee_data'
tableproperties("skip.header.line.count"="1")
What is difference between tail -f and tailf in unix?
The tailf
just waits almost infinite. But the tail -f
begin to print the output within seconds.
I have digged deeper by examining the underlying system calls using strace
command. The results given below:
# strace tailf /var/log/messages
(truncated)
stat("/var/log/messages", {st_mode=S_IFREG|0600, st_size=47432599401, ...}) = 0
open("/var/log/messages", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0600, st_size=47432600425, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7dba2d1000
read(3, "Nov 1 03:23:01 hostnameXXXX"..., 4096) = 4096
read(3, "0.31.148.12)\nNov 1 03:54:33 del"..., 4096) = 4096
read(3, "io.c(600) [receiver=3.0.6]\nNov "..., 4096) = 4096
(truncated)
As you can see, the tailf
is trying to read (buffer) all the lines from beginning before generating output to the screen.
Check the output of tail -f
below, here it is using the system call lseek
(C/C++) to directly jump to end of file and start reading from there:
# strace tail -f /var/log/messages
(truncated)
open("/var/log/messages", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0600, st_size=47294167448, ...}) = 0
lseek(3, 0, SEEK_CUR) = 0
lseek(3, 0, SEEK_END) = 47294170917
lseek(3, 47294169088, SEEK_SET) = 47294169088
(truncated)
Sunday, May 16, 2021
Connect Android Device to Ubuntu Laptop
Step 1: How to Install scrcpy in Ubuntu 18.04.5
Step 2: How to enable USB in Samsung Tablet.
Step A:
Settings
=> About tablet
=> Software Information
=> Build Number => here tab 7 times.. then Developer option will be
enabled.
Step B:
Settings
=>Enable USB Debugging
Step 3: Connect Table to Laptop with USB Cable
Step 4: Now Type the following to connect ti the tablet.
scrcpy --lock-video-orientation 1
Step 5: Increase screen size in scrcpy.
scrcpy 1.13 adds two new options related to orientation: an option to lock the video orientation, and shortcuts to rotate display in steps of 90°.
scrcpy --lock-video-orientation 0
90° counterclockwise:
scrcpy --lock-video-orientation 1
180°:
scrcpy --lock-video-orientation 2
90° clockwise:
Thursday, May 13, 2021
How to To Install Jupyter on Ubuntu 18.04
How to To Install Jupyter on Ubuntu 18.04
How to To Install Jupyter on Ubuntu 18.04
How to run Jupyter.
jupyter notebook --allow-root
Wednesday, May 12, 2021
Thursday, April 8, 2021
Executing shell script as cronjob
Problem: Executing shell script as cronjob
Solution:
Try,
#!/bin/bash
/bin/touch file.txt
cron as:
* * * * * /bin/sh /home/myUser/scripts/test.sh
And you can confirm this by:
# tailf /var/log/cron
Monday, February 15, 2021
Saturday, January 23, 2021
Friday, January 1, 2021
Scala REPL no echo on input Ask Question
This seems to be an issue with JLine2 being built with JDK9+, but being used on JDK8. If you're on bionic, try this PPA for jline2: https://launchpad.net/~lokkju/+archive/ubuntu/java-compat/
(or just download and install https://launchpad.net/~lokkju/+archive/ubuntu/java-compat/+build/16458066/+files/libjline2-java_2.14.6-1ubuntu1~bionicppa1_all.deb via dpkg)
You can verify jline2 is the problem by running scala -Ydebug
, and looking for ByteBuffer class not found error.
Recent Post
Databricks Delta table merge Example
here's some sample code that demonstrates a merge operation on a Delta table using PySpark: from pyspark.sql import SparkSession # cre...
-
OpenVPN 2.4 also became the default version your connections use. OpenVPN 2.4 adds many security and performance improvements. Because OpenV...
-
Step 1: we have check the installed sbt version . if sbt installed version on out laptop is say : 1.3.13 [info] welcome to sbt 1.3.13 ...
-
REST (Representational State Transfer) is style of architecture that enables development of loosely coupled systems by using the HTTP prot...