Google Map has APIs. But the requirement is that the Map image should be static and uploaded to the website only. No request or dependency on Google’s website should be needed so that the website can run without Internet. Is it possible or allowed (like a screenshot of the Google Map)? If not, any suggestions
Read more
Tag: www
How to find the disk where root / is on in Bash on Linux?
Posted onQuestion: how to find the disk where the Linux’s root(/) is on in Bash? The root may be on a LVM volume or on a raw disk. 2 cases: One example: # df -hT | grep /$ /dev/sda4 ext4 48G 32G 14G 71% / For another example: # df -hT | grep /$ /dev/mapper/fedora-root ext4
Read more
How to get the hostname of the node in C++?
Posted onIn C++, how to get the hostname of the node? In C++, the C way works too. However, with Boost, you can use the boost::asio::ip::host_name() function to get the hostname as a std::string: namespace boost { namespace asio { namespace ip { /// Get the current host name. BOOST_ASIO_DECL std::string host_name(); … More at http://www.boost.org/doc/libs/1_63_0/boost/asio/ip/host_name.hpp
Read more
How to process a file line by line in Bash?
Posted onIn Bash, how to process a file line by line? The file is a plain text line like input.txt. As an example, the process can be to just print it out. In Bash to process a file ./input.txt line by line: while read line ; do echo $line done < ./input.txt Reference: https://www.systutorials.com/qa/2166/how-to-process-a-file-line-by-line-in-go
How to make sort using multiple threads to run faster?
Posted onsort supports –parallel N to run N thread. However, it seems it only uses around 100% CPU as I observed although the command specified that N threads can be used. The command is as follows cat large-file | sort –parallel `nproc` where I have 16 from nproc. How to make sort use multiple threads to
Read more
How to get hostname in Python on Linux?
Posted onIn Python, how to get hostname as the command hostname does on Linux? In Python, you can get the hostname by the socket.gethostname() library function in the socket module: import socket hostname = socket.gethostname() Reference: https://www.systutorials.com/dtivl/20/how-to-get-the-hostname-of-the-node?show=34#a34
How to get an environment variable in Python?
Posted onIn Python, how to get an environment variable? In Python, you may use this piece of code to get an environment variable: os.environ.get(‘ENV_MIGHT_EXIST’) or this piece of code: os.getenv(‘ENV_MIGHT_EXIST’) It will return None if the environment variable is not present. Reference and for more ways, please check https://www.systutorials.com/dtivl/13/how-to-get-an-environment-variable?show=80#answer-80 .
How to set process with lowest priority?
Posted onIn system, sometimes, we need backstage threads with very very low priority since it cannot preempt any normal process asks for CPU. SCHED_IDLE class satisfies this requirement which has the priority lower than “nice=19” of CFS. Following code does this. 241 void set_idle_priority(void) { 242 struct sched_param param; 243 param.sched_priority = 0; 244 int s
Read more
How to do a good research in system field?
Posted onWe may need to check some materials about how to do good research in system field if you a Ph.D. focusing on system research. Some references: 1, How to write a good systems paper 2, How to be a good graduate student 3, Doing a System Ph.D. 4, Giving an Academic Talk Welcome to add
Read more
How to redirect non-www domain to www domain in .htaccess?
Posted onI have a website. But I would like use the www.example.com instead of example.com. How to redirect non-www domain to www domain on my server? I am using apache2 (httpd). You can add a piece of code into the top .htaccess in your site: Specific method: redirect example.com domain to www.example.com domain RewriteEngine On RewriteBase
Read more
How to use vnc to connect remote server with GUI desktop
Posted onFor my case, I need to bypass one intermediate server so that I can connect to the remote server with vnc. For example, there are two servers (s1, s2) except my local PC and I have to login to s1 so that I can login s2 from my local PC. However, now, I need to
Read more
How to install NAS benchmark
Posted onNAS benchmark link: http://www.nas.nasa.gov/publications/npb.html For Ubuntu, remember to install gfortran (sudo apt-get install gfortran) and change config/make.def to install NAS benchmark. Other distros are similar.
how to use pc internet of window8 on iphone 4s via usb
Posted onhow to use pc internet on iPhone 4s wia usb cable, pc is of window 8 and in network setting its not showing of connection of I phones network I ever wrote a tutorial at http://www.systutorials.com/136003/iphone-connecting-internet-using-windows-pc-network-through-usb-cable/ . But please be aware that it worked only on specific OS combinations. So, I am not sure whether
Read more
How to get the metadata of an AWS S3 object?
Posted onI upload files using the aws cli http://www.systutorials.com/239665/uploading-large-files-amazon-s3-aws-cli/ . But how to get the metadata of an object in AWS S3? You can use the s3api‘s head-object command to get the metadata of an object. Taking one example: $ aws s3api head-object –bucket test-hkust –key dir2/fileupload/fb0c6353-a90c-4522-9355-7cd16cf756ff.file.txt It will print results like { “AcceptRanges”: “bytes”, “ContentType”:
Read more
how change my policy of scheduling in hadoop?
Posted onI want to change policy of scheduling in Hadoop, how to I can change job order in map reduce automatically. Assume you are using Hadoop 2 / YARN. The configuration parameter named yarn.resourcemanager.scheduler.class controls the class to be used as the resource scheduler for YARN/Hadoop. The default value for the scheduler class (check more at
Read more
How to get a script’s directory reliably in Bash on Linux?
Posted onHow to get a script’s directory reliably in Bash on Linux? For example, to get the directory of the executing script $0. dirname can give you the directory name from the absolute path. You can get the absolute path of the script by readlink -f to handle symbolic links (consider a symbolic link ./run.sh linked
Read more
How to install Windows from USB drive?
Posted onI have downloaded the iso file of Windows 10 installation disk from https://www.microsoft.com/en-us/software-download/windows10ISO . But I do not have a DVD R/W drive. Whether and how to install Windows from a USB drive? You can use the Windows USB/DVD Download Tool to make a USB from the Windows ISO. Download and install the Windows USB/DVD
Read more
Free VNC server software on Windows
Posted onRealVNC only gives free version to personal usage of their server software while it limits the functions. Could you suggest some good free VNC server software with full functions? TightVNC is an open-source software for VNC with servers and clients. You can download the server software for Windows from TightVNC download page: http://www.tightvnc.com/download.php The software
Read more
How to install Chrome on Fedora Linux?
Posted onHow to install the Chrome browser on Fedora Linux from Google? Google provides a repository for yum/dnf on Fedora. First, following http://www.systutorials.com/3471/additional-repositories-for-fedora-linux/#google-chrome-repository to add Google Chrome repository. Then, you can install Google Chrome by yum/dnf: # dnf install google-chrome-stable
How to open a URL in a new window in JavaScript?
Posted onHow to open a URL in a new window in JavaScript? For example, to open a new window to browse “http://www.systutorials.com“. Open the URL in a new window: url = “http://www.systutorials.com”; window.open(url); Some browser will open the window in a new tab depending on the configuration. If you want to force the browser to open
Read more