Categories
Linux Mastering Development

Acquire::By-Hash apt option does not work

I’m trying to make apt-get use Acquire::By-Hash option, so it will download packages identifying them by cryptographic hash, not by package version. This should prevent race conditions and "Hash Sum Mismatch" errors happening sometimes while trying to apt-get install something. I can’t make apt-get use this method. I tried Putting Acquire::By-Hash "force"; to /etc/apt/apt.conf.d/51acquire_by_hash Changing […]

Categories
Linux Mastering Development

Find the maximum every 10 rows in a particular column and print the entire row

I would like to find the maximum value in the column no. 5 (Determine) for every 10 rows and then print the corresponding entire row. For eg. in the first 10 rows, the maximum value in the 5th column is ‘1.1824’ and the corresponding entire row is "10_M62 6: 3.0561 405.69 1.1824". I want to […]

Categories
Linux Mastering Development

How can I add custom CSS to the result of the markdown command?

New to markdown… I have a very simple markdown file, I am using the markdown command markdown something.md -o something.html Is it possible for me to inject my own css into the something.html file

Categories
Linux Mastering Development

How is disk utilization measured?

For context, I am a self-taught developer, and I picked up Cloud operations along the way. I gained the interest on Performance, so I picked up the book "Systems Performance" by Brendan Gregg. In the book, there is a case study about slow disks. It appears that the "disk utilization" is at 80%. I’m trying […]

Categories
Linux Mastering Development

Set lxterminal to show more lines

I am using debian+lxde,the terminal is lxterminal,already set scrollback as a huge nuber 10000. cat .config/lxterminal/lxterminal.conf |grep scrollback scrollback=10000 The bash history contains almost 2000 records,in lxterminal to input history ,it can only show part of history records ,about 1000 records ,how to display all the history records?

Categories
Linux Mastering Development

Wine only works when there is internet

This is strange behavior I notice after I test running Windows application from different folder than Wine default folder (the application is Photoshop 2015 ) , what’s make this even stranger is Winecfg wont start without internet connection too Here is error messages from the terminal I got . 002c:fixme:winediag:start_process Wine Staging 5.13 is a […]

Categories
Linux Mastering Development

Is there a way to use a variable when defining an array?

So I was trying to test something to get around argument list too long issues when storing large files as variables. lets_build_something_together () { file_name="$@"; short=$(basename "${file_name}" | sed -e ‘s/ /_/g’); unset make_file_array; while read file_array; do export make_file_array_${short}+=($(<${file_array})); done < <(split –verbose -b 1024 "${file_name}" | awk -F\’ ‘/file/{print $2}’) } This is […]

Categories
Mastering Development

JAVA how to get nested JSON content by Key?

I have the following code which I use to download a JSON file from a URL: static void getPost() throws Exception { String webPage = "https://www.reddit.com/r/arabfunny/top.json?limit=100"; URL url = new URL(webPage); URLConnection request = url.openConnection(); request.setRequestProperty("Content-Type", "application/json; utf-8"); request.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"); JsonParser jp = new […]

Categories
Mastering Development

Re render child components in svelte

i’m using svelte for my new project and pretty new to it. I have a parent component with multiple child components. on child component allows me to select a date, and then i want to re render automatically all other child components using this date. Actually, they won’t rerender, unless i use a store, but […]

Categories
Mastering Development

Rails returns HTML, even with `application/json` set and `.json` added to resource

Attempting to render JSON via Jbuilder when an XHR request is sent to Rails, and HTML when a normal request is sent. But every request still returns HTML. Without JBuilder PostController has a show action. It renders html and json. def show @post = Post.find(1) respond_to do |format| format.html format.json { render json: @post} end […]