ubuntu – How to Link css which is located out side of the document root

my folder Structure is like

devlopment{
   core{index.php}
   css{index.css}
}

My document root is devlopment/core,
I Want to link index.css file using link tag and href i tried is ../css/index.css Which is not working,
To solve this I found solution that i have to change alias in apache2 server but how to do that i don’t know please help

web browser – How do applications which are integrated using a javascript client side sdk, secure their data or disallow spam?

Take an example of google maps. google maps provides a javascript client SDK, which means any web app running javascript can access the google maps sdk. You need to use an API_KEY so that google can rate limit your requests, and apply some quota on the requests coming from your api key. If you exceed the quota you would be charged more.

The API_KEY has to be specified in the client side javascript, so it would be visible to anyone who uses your application, and then anyone can abuse your quota. To get around this, google suggests to add referrer based security while setting up your sdk on the google app console. You can specify a list of origins that google would accept requests from, based on the referrer header. So if someone gets your api key and tries to use that from another web application running on another domain, either google would not respond to those requests, or, the request wouldn’t be added in your quota. This acts as a basic level of security, BUT, the referrer header can be easily spoofed.

Now google maps does not have any user specific data, so may be API_KEY abuse is not that big an issue.

Consider an application like sentry, which allows a javascript client to send events to a sentry server. Sentry can also impose similar restrictions based on the referrer or origin header, and only allow events to your sentry server from certain domains. But wouldn’t it be easy for someone to directly send events to your sentry and spam your sentry server?
Sentry suggests to not send any PII in the events anyway, so in case it was possible to get data somehow, at least the guidelines are clear.

But what about products like Intercom, where the primary functionality is collecting user data in some form or the other. If someone knows the unique id of another user in intercom, they can basically see all the data from the other user, their chats , their messages etc. Intercom is a completely frontend setup, where the request to the intercom script and the intercom server happen through the front end, so if the front end can get user’s data through intercom, then any other user can get another user’s data by initiating intercom with the other user’s id on their browser or directly using curl. There is no auth as such, there is an app key which is also completely frontend.

I am just trying to understand how do such applications secure themselves?

Some points about intercom:

  • it opens in an iframe, with intercom.com domain
  • possibly the api has CORS restrictions, so only requests from intercom.com domain are allowed, but these restrictions are not applicable for curl
  • it exposes some javascript methods to initialize with a app secret and you can pass a unique id for the user. The app key is frontend only so can easily be seen in any integration, and the user id can be leaked through other ways. Once leaked, I can just use this user id and the secret key from anywhere to get messages for the user.

SSH into raspberry pi on WAN side of router

can anyone help me figure out how to SSH into my raspberry pi in the following situation? I have an android phone using easytether connected via usb to the pi, then I connected the pi via ethernet to my wireless router’s WAN port. I am unable to figure out how to SSH into the pi on the WAN side of the router from a PC on the LAN side. Do I need to setup a reverse tunnel or port forwarding? I cannot get it to work.

enter image description here

macbook pro – How do I troubleshoot screen capture utilities only capturing one side of audio?

I use screen capture utilities like Movavi and Snagit on my MacBook Pro 2019 (Big Sur) to record software demos. When using a headset or any other microphone connected to a USB port, the recorded audio is in stereo.

When I use any external audio interface (PreSonus Studio 24C or Behringer U-Phoria UM2) as the captured audio source, I only get one side (the left side) of the audio. Using either interface with an application that doesn’t capture the screen in any way works perfectly, clear audio from both sides.

I’m certain that the audio interfaces are working properly. For instance, I can record my voice just fine using Vector 3 (or any other audio recorder) and the audio interface, and it’s clear stereo.

I need to use an audio interface because the mic I need to make a good recording needs an interface in order to work with my MacBook Pro. I haven’t had a lot of luck troubleshooting this, even through contacting support from Movavi and Snagit. I’m trying my best to go through all possible system settings and configuration tweaks that I can – is this a common problem with screen capture scenarios? I was about to chalk it up to a third-party bug, but this seems to persist no matter what utility I use, yet the audio interfaces work perfectly fine with any other software that isn’t doing a screen recording and I’m a little baffled as to why.

Material Design guideline for Google Map’s side pane?

Here is what happens when you click on an icon in an “old-style” Google map:

old Google Maps

You get an InfoWindow, and clicking "more info" opens a new tab with a google search of the icon’s subject.

Here is what happens when you click on an icon in a “new-style” Google map:

new Google Maps

You get more information outside the map that you can then interact with.

I understand why the new way is better- you can show more information, it’s more mobile-friendly, and it helps de-clutter the map.

My question is: Is there a specific material design guideline that motivated this change from the old InfoWindow style to the new “sidebar” style? I doubt there’s something as obvious as “don’t use InfoWindows on maps anymore, use this instead”, but I’m looking for something a little more official than me just guessing.

Bonus question: What is that sidebar component called?

The reason I’m asking is: At my job we have a product that uses the Google Maps API to show various hierarchical information:

  • You click on a dot on the map
  • That pops up an expanded view of the data on the map
  • You click in the expanded view and you get an InfoWindow with more details.

My job’s clients don’t like the InfoWindow display, and I’m thinking that we should get away from on-the-map displays and move towards this new-style sidebar interface. I’m looking for something a little more official than my humble opinion, but nothing in the material design docs really jump out at me.

What’s the minimal lenghth of each side of an equilateral triangle that can get a square of 15 mm inside it?

If I want to know What’s the minimal length of each side of an equilateral triangle that can get a square of which each of its sides is 15 mm, inside it (=inside the square)?. How to calculate it?
(I’m not looking for the answer, but I’m looking for the way or approach to solving it, for future self-solutions).

Hashing unvariant tables to ease caching on client side

Hi, I’m working on my first project that requires a database and I was hoping to get an opinion on an idea I just had. Sorry if it’s too basic or already implemented in a framework. I couldn’t find anything like this on google.
SEMrush

I was thinking on caching some of the tables that have lots of reads and few writes in the client application. To make sure the cached table is the same as the one in the database I wanted the client application to send a precalculated hash of the cached table when making a request. The server application would compare it against its own precalculated hash stored in the DB (which I’d keep updated through triggers) and if it’s the same it’d send a confirmation instead of the whole table.

Am I over engineering this? My main reason to do it this way is to give the user a more fluent experience. I used a dozen applications similar to the one I want to make and there’s always a second or 2 of delay for the ones where the client app is browser based.
The other ones I used had on site server or even managed the data on the same computer, so it’s not really comparable.

I’m using postgres and the client application will be a PWA. I expect the tables to have peaks of a thousand reads per hour and the tables shouldn’t have over 200 rows and 10 columns.

 

themes – removing side space between para and container on generatepress?

You can always use the “Inspect Tool” in your browser to see the details of the object (structure and style). Though I checked your page and didn’t see anything wrong with it. As you can see in the list in the top of your picture, the last item has a few space.

Another point is in the beginning of the line, all words start in the same place and the left padding would be OK. But since all the words does not have the same length and they can be half-written in the end of the line, so the long words may be placed on the next line. This way some lines might be shorter and some lines might be longer and you think that there’s something wrong with the space ( As you can see in the “Power” paragraph and the last 3 lines ).

graphics3d – Would replacing one side of the Dynamic Clock Box with an image be easy or a complete rewrite?

I’ve been looking at the code and reading other questions. I don’t know where to start. Here is the code from the Wolfram example with the addition of importing and resizing an image in the first two lines. I also changed one of the coords elements to {0.5, 0.5, 0.5}.

pablo = WebImage(
   "https://commons.wikimedia.org/wiki/Category:Pablo_Picasso#/media/
File:Pablo_picasso_1.jpg");
pablo1 = ImageTake(pablo, {101, 500}, {201, 600});

vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0.5, 0.5, 
     0.5}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 
     0}, {1, 1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 
     1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}, {{0, 0, 
     1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}};
DynamicModule({}, 
 Graphics3D({Dynamic(Texture(clock), UpdateInterval -> 1), 
   Polygon(coords, VertexTextureCoordinates -> Table(vtc, {6}))}, 
  Lighting -> "Neutral", Boxed -> False), 
 Initialization :> (clock := 
    Module({hour, min, sec, ht, mt, st}, {hour, min, sec} = 
      Take(DateList(), -3); 
     ht = Pi/2 - 2 (Pi) hour/12 - (2 (Pi)) min/720; 
     mt = Pi/2 - 2 (Pi) min/60; st = Pi/2 - 2 (Pi) Floor(sec)/60; 
     Graphics({Thick, Arrowheads(Large), 
       Arrow({{0, 0}, 0.6 {Cos(ht), Sin(ht)}}), 
       Arrow({{0, 0}, 0.9 {Cos(mt), Sin(mt)}}), PointSize(Large), 
       Table(Point(0.9 {Cos(i), Sin(i)}), {i, 0, 2 Pi, (Pi)/6}), 
       Point({0, 0}), Circle(), Red, 
       Line({{0, 0}, 0.85 {Cos(st), Sin(st)}})}))))

plugin development – Detect if requested page is PWA on server side

I’m trying to determine if the user is browsing PWA on server side. On client side I can check if the browser mode is standalone via JavaScript and detect PWA, but on server side this is not an option. So I’m using simple query parameter for that. Start URL in manifest has query param isPwa appended and every time user opens PWA, it goes to https://example.com/?isPwa. What I need now is to keep that parameter while user browses PWA, so I need to set isPwa parameter to next URL that user opens if the referer URL already had isPwa parameter, but my code goes to redirection loop and I’m unable to identify the cause of this. Here’s my code:

function addIsPwaQueryArg() {
    $referer = wp_get_referer();
    if (strpos($referer, 'isPwa') !== false) {
        $location = remove_query_arg('isPwa');
        wp_redirect(add_query_arg('isPwa', '', $location));
        exit;
    }
}
add_action('template_redirect', 'addIsPwaQueryArg');

Can someone tell me what’s wrong with my code and why is it not working?

Thanks!