Categories
Development Linux

Startx as non-root user via SSH

I have a remote VM running Ubuntu 1804 and would like to run VNC. I am using x11vnc, which requires an X server to be running. Currently, I’m connected through SSH. The VM has an Nvidia card, and after generating the xorg.conf with nvidia-xconfig, I can start an X session using startx, but only as […]

Categories
Development Linux

Allow the contents of a server port to be accessible to public

I have a live, automatically updating plot(using Bokeh) in python being displayed in a remote Linux server(set up by my university for me) at its port 127.0.0.1:5006. Usually, I have to connect to the server through SSH with a port forwarding enabled for that address to see the plot in my local machine. My question […]

Categories
Development Linux

Comparing two tsv files

I am trying to compare two tsv files. The file to be queried (file1) looks like: Chr Start End chr1 234738546 234738934 chr1 234792654 234793537 chr1 234908151 234908864 chr1 235097868 235098170 chr1 236080566 236081347 chr1 240307621 240308262 chr1 240308207 240308637 chr1 240308546 240308962 chr1 242627058 242627262 chr1 243923195 243923709 The second column of another file […]

Categories
Development Linux

Create and use custom .profile file

Our current Linux distribution doesn’t show .proflle file in the user home folder, but as we are using ksh shell, we have the .kshrd file available. However, without playing with the kshrc file, can I create my own .profile that will contain custom environment specific details required for script run, and how can I use […]

Categories
Development Linux Python

How to process all files in a folder with python code

I have the following code in python: #/usr/bin/python from Bio import SeqIO count = SeqIO.convert(“genome1.gbk”, “genbank”, “genome1.fasta”, “fasta”) print(“Converted %i records” % count) This code converts the genbank file “genome1.gbk” to a fasta file “genome1.fasta”. But now I want to convert all files in the current folder with this code. All the files in the […]

Categories
Development Linux

Executing a Program with input

I would like to be able to run a program and then feed that program some information all in one line on startup. Suppose I am in the working directory of the executable (sage), I can run ./sage -c “print(‘hi’)” and it will write hi to the terminal. It’s clearly fed sage the command to […]

Categories
Development Linux

Multicast packets being dropped at IP layer?

External multicast data is being received by machine #1 and forwarded to machine #2. On machine #2 I can see the multicast packets being received when I use tcpdump, ethtool and netstat -i (ethernet layer). However, when I run netstat -s -u the number of UDP packets isn’t increasing, nor is InMcastPkts but InOctets is […]

Categories
Development Linux

Why would a ssh password-based login fail?

I currently use ssh keys to connect to my server (Ubuntu 18.04). I would like to allow (in a specific, limited scope) the ability to login with passwords. Whenever I try, my passwords fail. below is a session where I set a password, then try to use it: ~ # id uid=0(root) gid=0(root) groups=0(root) ~ […]

Categories
Development Linux

Tweak to create 50+ VNC/Gnome sessions (dubs/systemctl limits)

I am trying to create 50 VNC display session on a CentOS 7.6 machine. I created a local user. Once logged in, I could create only 9 sessions. After this VNC Server starts, immediately errors out with Sample VNC log Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt) See http://www.tigervnc.org for information on […]

Categories
Development Linux

how to parse multi dynamic lines while on one of the lines?

I have a directory with some text files that have data like below, I read them via a loop and put each line in an array! ( first of all as a starter I don’t the correct way if you know any better way let me know ) Attack On Titan S03E20 720p WEB x264-URANiME[eztv] […]