How to scp with a second remote host
- date: April 30, 2014
I wonder if there is a way for me to SCP the file from remote2 host directly from my local machine by going through a remote1 host.
The networks only allow connections to remote2 host from remote1 host. Also, neither remote1 host nor remote2 host can scp to my local machine.
Is there something like:
scp [email protected]
First window: ssh remote1, then scp remot2:file ..
Second shell: scp remote1:file .
First window: rm file; logout
I could write a script to do all these steps, but if there is a direct way, I would rather use it.
EDIT: I am thinking something like opening SSH tunnels but i'm confused on what value to put where.
At the moment, to access remote1, i have the following in $HOME/.ssh/config on my local machine.
Once on remote1, to access remote2, it's the standard local DNS and port 22. What should I put on remote1 and/or change on localhost?
How to work with multiple ssh keys [duplicate]
location: linuxexchange.com - date: March 8, 2013
This question already has an answer here:
Multiple GitHub Accounts & SSH Config
How to useradd with multiple parameters
location: linuxexchange.com - date: October 2, 2010
I'm trying to use multiple parameters with the useradd command in linux, and I'm not really sure exactly what I should do??
I have tried the following:
useradd -b /home/ -g admin -m -p PASSWD -s USERNAME
Needless to say, it doesn't work. Can anyone tell me the correct syntax to get this working? Thanks, your help is always appreciated!
EDIT: I'm not getting an error message, It is just returning the flag variables followed by an ng
How to manipulate with magnetic tapes in C/C++? [closed]
location: linuxexchange.com - date: January 23, 2015
I need to do a few basic operations with magnetic tapes on our tape server:
display statistics (equivalent to mt stat command in Linux)
read/write data onto blocks of tapes
I want to do perform these tasks via an API/library in C/C++ but I'm really struggling with finding instructions/tutorial for beginners.
Can you somehow use sg driver, functions from sg3_utils or some toying with ioctl()?
How to deal with the ECC support feature in NVIDIA graphics cards
location: linuxexchange.com - date: September 7, 2014
the server have setup two NVIDIA K20m cards, but with ECC enabled. I have observed that the Volatile GPU-Utilization is high using the nvidia-smi -a command, even through no computing task is running in the card. The K20m is just used for computing. I have searched in Google, and checked the following links: https://devtalk.nvidia.com/default/topic/539632/k20-with-high-utilization-but-no-compute-processes-/ and https://devtalk.nvidia.com/default/topic/464744/how-to-disable-enable-ecc-on-c2050-/
It seems the ECC is always a bad feature, so it is always set to be disabled. So what's the true meaning with the ECC? I'm just a commont user of that server, so I don't have the right to use the command nvidia-smi -e 0 to set ECC to be disabled. Is it possible for common user to set the ECC to be disabled?
What are the effects when we turn off the ECC? When should we turn it on? and when off?
How to work with useragent to download a webpage using Wget
location: linuxexchange.com - date: May 27, 2015
I am trying to download this page using Wget. Here is the page link:
And here is my cmd:
wget -O ebay.html --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rt=nc&item=250972882769&si=a8iGAIchyvEbn7KveYFZ5QbEE7o%3D&print=all&category=31387"
When I use it to access the page using a browser it works fine. When I use Wget, it downloads another page, not the original one. I think the problem is for user-agent. What's the solution?
location: linuxexchange.com - date: July 2, 2012
I notice that after using firefox for a couple of hours it gets more that 2gb of ram memory. It happens expecially when I upload big files (100mb-400mb) with ajax uploader, and also happens when I open to many images (for example 16mb of total images on a web page).
The problem is that even after upload finish or after closing the images pages the memory is not getting free, firefox still have 2gb of ram memory.
From about:memory :
1,172.03 MB (100.0%) -- explicit
├──1,000.00 MB (85.32%) -- js
│ ├────863.97 MB (73.72%) -- compartment([System Principal], 0x5083000)
│ │ ├──819.31 MB (69.91%) ── string-chars
How can I empty string-chars that I am pretty sure this comes when the files are readed into memory and then uploaded with ajax?
Here is the recrusive function causing this memory usage:
How to deal with LinkageErrors in Java?
location: linuxexchange.com - date: September 1, 2015
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
My application, using the Java Plugin Framework, appears unable to convert a dom4j-created XML document to Batik's implementation of the SVG specification.
On the console, I learn that an error occurs:
Exception in thread "AWT-EventQueue-0" java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.batik.dom.svg.SVGOMDocument.createAttribute(Ljava/lang/String;)Lorg/w3c/dom/Attr;" the class loader (instance of org/java/plugin/standard/StandardPluginClassLoader) of the current class, org/apache/batik/dom/svg/SVGOMDocument, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Document have different Class objects for the type org/w3c/dom/Attr used in the signature
How to crosscompile with MinGW on Linux for Windows?
location: linuxexchange.com - date: March 17, 2015
I'm trying to compile a Qt5 application for Windows on Linux with MinGW.
I'm using Travis-CI to get continuous builds of two windows executables (win32, win64).
I've set up a build matrix, which contains the definition of the different MinGW dependencies. The before-install section defines the Qt, MinGW and gcc dependencies. The packages are fetched during install.
This is my .travis.yml:
# cross-compile using mingw
- compiler: ": w64"
env: PLATFORM="mingw32" ARCH="x86_64" BITSIZE=64 HOST="x86_64"
- compiler: ": w32"
env: PLATFORM="mingw32" ARCH="x86" BITSIZE=32 HOST="i686"
- sudo add-apt-repository --yes ppa:beineri/opt-qt54 # < Qt
- sudo add-apt-repository --yes ppa:tobydox/mingw-x-precise # < MinGW
- sudo apt-get update -qq
- uname -m
- sudo apt-get install qt54base qt54imageformats qt54tools -y -qq
- export QTDIR=/opt/qt54
- export PATH=$QTDIR/bin:$PAT
Linux QT Creator C++: How to link with $$HOME?
location: linuxexchange.com - date: August 25, 2014
I start a programm which includes a library (IDA) in
The library IDA has two folders:
/home/MYUSERNAME/EB/IDA/IDA/Includes/ (for h-file)
/home/MYUSERNAME/EB/IDA/IDA/Libs/ (for so-files)
This is the linking which works:
LIBS += -L$$PWD/../IDA/Libs/ -Wl,-rpath=$$PWD/../IDA/Libs/ -lIDA -ldl -lpthread -lrt
INCLUDEPATH += $$PWD/../IDA/Includes/
The problem is that PWD only shows the path in which Earlybite starts. In this case
/home/MYUSERNAME/EB/IDA/Earlybite/, but if the programm starts e.g. in /home/MYUSERNAME/EB/IDA/ ...the linking will not work.
So I tried to link with the HOME environment variable. E.g.
LIBS += -L$$HOME/EB/IDA/IDA/Libs/ -Wl,-rpath=$$HOME/EB/IDA/IDA/Libs/ -lIDA -ldl -lpthread -lrt
INCLUDEPATH += $$HOME/EB/IDA/IDA/Includes/
But this do not work.
I also tried
LIBS += -L/home/$$USER/EB/IDA/IDA/Libs/ -Wl,-rpath=/home/$$USER/EB/IDA/IDA/Libs/ -lIDA -ldl -lpthread -lrt
INCLUDEPATH += /home/$$USER/EB/IDA/IDA/Includes/
Page: 1 2 3 4 5 6 7 8 9 10