Select all consecutive lines starting with “.”, except last one

So I’m cleaning up a text file full of folders and documents that leaked somewhere. My point is to use regex to ease my job of finding if anything of ours has been compromised (obviously, it has). I already got rid of some 80% of the junk that ain’t ours, but suddenly I was left with a lot of empty folders on the listing. Since they start with “.” and the empty ones are consecutive, here I am.

One example would be:

./folder1/folder2/folder3: ./folder1/folder2/folder4: ./folder1/folder2/folder5: -rwxr-xr-x  1    514K  3 Out 08:06 somefilename.here 

And my goal is to remove the first and second lines. Bear with me, the original files has over 15k lines, the cleaned up was left with some 3k. So there isn’t just these two lines to remove, but they fit the profile perfectly.

I was thinking about something like (^\..*\n)+\., but it still selects the last line, and I want that to stay.

How to block everything except my connection to the VPN?

I’m trying to make Murus block everything, except my connection to the VPN server. I don’t want my Mac to make any outbound calls to any ports unless via the VPN connection. I’m trying to add a rule that allows the VPN, while everything else is blocked by set block-policy drop.

I can connect to the VPN, but nothing works aside from that. Can you point me to the right direction?

trying to destroy all previous session except the current but still destroys all

As mentioned in the question, i’m trying to destroy all previous sessions except the current using destroy_others(wp_get_session_token()) but the function still destroys all and i don’t where the problem is.

In the following i have the _login_count meta key which stores a limit of active logins for a user, which i compare with the count of session tokens, and destroy other sessions if the tokens count is more than the limit set to a user, but it destroys all. what is wrong?

I have set the limit to 2 active logins but once i login third time all previous sessions are destroyed and the third one expires on refresh, which means it deleted all sessions

function lums_only_one_session(){         if(!current_user_can('administrator')){             //get current user id             $  user_id = get_current_user_id();             //get the user login allowed session count             $  _login_count = get_the_author_meta('_login_count', $  user_id);             //get user sessions             $  user_sessions = get_user_meta($  user_id, 'session_tokens', true);             // get login timestamp from all sessions             $  login_timestamps = (!empty($  user_sessions)) ? array_values(wp_list_pluck($  user_sessions, 'login')):array();             //check whether user's session less then the limit specified by the administrator, then continue              if (count($  login_timestamps) <= $  _login_count) {                 //return                 return $  user;             } else {                 //get all active sessions of the user                 $  sessions = WP_Session_Tokens::get_instance($  user_id);                 // we got all the sessions, just destroy them all at once.(remove comment)                 //$  sessions->destroy_all();                  /*Destroy all session tokens for this user,                  * except a single token, presumably the one in use.                  */                 $  sessions->destroy_others(wp_get_session_token());             }         }  }  add_action( 'wp_login', 'lums_only_one_session' ); 

Snort not sniffing any traffic except it’s own

I’m currently trying to set up Snort on my local machine. At the moment I have 3 VM’s: 1 with snort on it and 2 used to ping eachother. Whenever I ping from one of the devices to the Snort-machine, Snort notices it and sends an alert. However, when I ping between the 2 ‘not Snort’ machines, snort doesn’t notice anything.

I’ve always been told that Snort would act like Wireshark and notice all the network’s traffic. Am I wrong in this?

If it helps, this is the guide I used: https://upcloud.com/community/tutorials/install-snort-ubuntu/

Thanks in advance!

how to forward all ports except one with htaccess? [on hold]

Let’s assume there is a website with the number of services on different ports. I cannot uninstall those services because it is shared hosting. Is that possible to block or rewrite all ports to 443 ports with htaccess?

Following did not work:

RewriteCond "%{SERVER_PORT}" "!^443$  " RewriteRule ^(.*)$   https://%1/$  1 [R=301,L] 

Note the question is not about rewriting http to https. But how to rewrite ports?

In Gmail, is there a scalable way to forward all email except?

In Gmail, is there a scalable way to forward all email except?

I have seen some solutions to the problem e.g.

Forward All Except Filter in Gmail

mentions the idea that you can have a conditional like from:(-(address1@gmail.com OR address2@gmail.com)) which you can put in the “Has the words” field. And no doubt you can put normal words in there too like “Congratulations you got this email you don’t want”

i.e. turn off the general forwarding (which would forward everything with no exceptions)

And make one single filter that forward email(so ticking the forward box on the filter), and then add negative conditions.. so it will forward all email except certain email.

The problem is, if I want to choose to not forward

all email that has these words (A)

all email that has those words (B)

all email that is from this person and has these words (C)

all email that is from that person and has the following words (D)

Then sure I suppose I could have a conditional

NOT (A OR B OR C OR D) aka (NOT A) AND (NOT B) AND (NOT C) AND (NOT D)

But any of A or B or C or D might be quite long e.g. specifying a bunch of words. e.g. A might look for words “You signed up for this congratulations”.

And it’d be really ugly since google only gives a single line to put it all on, and I wonder how long it’d be before gmail chokes on it due to reaching a limit to the end of the string!

The way google could solve this problem would be to allow General forwarding but let the general forwarding have exceptions. Then when any filter is made, and general forwarding has been set, then let forwarding be ticked by default, and let unticking it override the general forwarding. Unfortunately the forwarding option of an individual filter doesn’t override the general one.

And if i turn off the general one and do the solution of using an individual filter then it’s just not scalable.

Is there any scalable solution?

Notepad++ Regular Expression Find and Replace 2 characters from line except it starts with

so I am new into Regular Expression and I have this problem here:
I need to replace this line of a text
Style: main,Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,1.35,0.0,2,0010,0010,0020,1

to this
Style: main,Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,85,100,0,0,1,1.35,0,2,10,10,20,1
BUT it should skip all lines starting withStyle: sign… Could anyone help me please? Thanks!
This is really frustrating for me right now