linux

  1. P

    WAN Optimization Resources

    I'm looking for resources on writing software to do WAN optimization. I've googled this and searched SO, but there doesn't seem to be much around. The only things I've found are high-level articles in tech magazines, and info for network admins on how to make use of existing WAN optimization...
  2. C

    Country and External IP Bash script

    I created a script based on what I could find on the INTERNET and some bash tutorials, that will show me my external IP and the country it's located in. # Script looks like this: #!/bin/bash wanip=$(dig +short myip.opendns.com @resolver1.opendns.com); echo "$wanip" > /root/Documents/filewanip...
  3. J

    How to read stale values on x86

    My goal is to read in stale and outdated values of memory without cache-coherence. I have attempted to use prefetchnta to perform a non-temporal load, but it failed to fetch outdated values. I am looking into performing some kind of Streaming Memory-to-Memory Direct-Memory-Access, but am having...
  4. A

    Running a python file from current location to another one?

    I am new in Ubuntu :) By using Terminal now i am on particular location and i want to run a python file that found in another location ? what the correct command to run this file in the current location? Thanks in advance
  5. J

    Copy directory to external HDD

    I am finding way to copy a directory to external HDD.It could be called clone (I don't know how it is called in Linux world). I know the basic command like (cp -a {host} {destination}). It is for one time copying. I would like to update in external whenever make change(add new or delete file)...
  6. N

    Can we allocate physically contiguous memory by mmap()?

    I need physically contiguous memory in aarch64 Linux 4.15 for an experimental purpose. I guessed if the required size is smaller than the page size, the allocated memory may be physically contiguous as below. void * p = mmap(0, getpagesize() - 1, PROT_READ | PROT_WRITE, MAP_SHARED, 0, 0)...
  7. J

    Select a jar file in maven project

    I have a jar file in my target directory of Jenkins Maven project. PROJ-0.0.2-SNAPSHOT.jar. There is another file called, PROJ-0.0.2-SNAPSHOT.jar.original I want to select only PROJ-0.0.2-SNAPSHOT.jar file. For that I used below command. ls target | grep \.jar$ I got the output as my...
  8. C

    What happens if I turn off a device before “sync”?

    I have an embedded device (Linux + BusyBox) on which I loaded a file "my_file.txt". I used catto check the contens of the file, and it was satisfactory. Then, I pulled the plug and after reboot, I saw the file was still there, but with 0 bytes size... Can that be caused by an unsync file-system...
  9. B

    Cannot connect to the Docker daemon at unix:///var/run/docker.sock?

    $sudo service docker start * Starting Docker: docker $sudo service docker status * Docker is not running $sudo docker pull bkimminich/juice-shop Using default tag: latest Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at...
  10. E

    Am I using the correct syntax for my shell script? [duplicate]

    I wrote a shell script that gets a value from a file and based on that value I want to echo a particular message. My console keeps on saying that there is an error on line 7 and 9. Any suggestions on how to fix it will be greatly appreciated. export...
  11. T

    Bash script to ensure only one instance of a script running & others waiting

    I have a bash script runner.sh which invokes another script.sh. script.sh is invoked only from runner.sh. I can have only one instance of script.sh executing at a time. If multiple invocations of runner.sh is made then runner.sh should make all the caller's wait if script.sh is already running...
  12. C

    Serving many sites on same address and port without IIS

    I need to serve many sites, on the same address and port, with different path, without using IIS. For example, two static sites and one NodeJS server. I want to access them in these addresses: http://localhost:80/static1 http://localhost:80/static2 http://localhost:80/node_server I want also...
  13. S

    Keyboard shortcuts giving me errors in tkinter

    I am trying to create a text editor with python 3 and tkinter. The text editor works great except for when I try to use my keyboard shortcuts. Whenever I use any of the shortcuts, I get an error that says this: Traceback (most recent call last): File...
  14. J

    Pass variable as options to curl in shell script linux [duplicate]

    I'm trying to update some info of a web site using curl through a script but it's not working well, this is the code i have: CURL_STD_OPTS="-k --header 'Content-Type: application/json' --header 'Accept: application/json' curl "$CURL_STD_OPTS" -X POST --data '{ "actual": '"$BAL"' }'...
  15. D

    Extract specific XMLs from log file

    I have large log files (around 50mb each), which contain java debug information plus all kinds of XML responses Here's an example of something I'm trying to extract from the log <envelope> <response> <ATTR name="uniqueid" value="XYZ_00000-00-00_12345_1"/> <ATTR name="status"...
  16. D

    Bash function doesn't work for remote ssh command execution although interactive shell function fine

    I define a function in .bash_aliases file and include it in my .bashrc file. My .bash_aliases file: function dmidecode() { if [[ $1 == -t && $2 == 1 ]]; then cat ~/some_file else command dmidecode "$@" fi } The function is: when someone...
  17. D

    SSH permission denied (public-key)

    I am stuck trying to get SSH to work from my iMac to my desktop running Ubuntu. I've combed through the forums for a solution but nothing has worked for me so far. Strangely, I can SSH in from my MacBook running a near identical version of macOS. This perhaps rules out any issues with the SSH...
  18. D

    How to append values to an array in Bash by adding one element to the previous entry?

    I have a list of numbers 1 2 3 4 5 that I am trying to organize into an array where the values are in a sequence where the current value is the summation of the previous values in the array (like this): 1 3 6 10 15. My current code is as follows: array=() for n in `seq 1 5` do if [ $n -eq 1...
  19. J

    Pipe echo of change the current directory to sh does not work

    If I do the code: echo "printf 'working'" | sh the code prints out working but when I want to change the current directory this way: echo "cd ../" | sh the current directory isn't changed. Do you know the reason behind that behavior? do you know how to echo cd command to sh in a working way?
  20. F

    How do I create a file I can stream data to in Python?

    I'd like to create a file similar to those under /dev that I can stream lines of text to without actually writing anything to the disk. I want to still be able to read this stream like a regular text file.
Top