Home Page
RABiD BUNNY FEVER
K.T.K

  • July 20, 2018, 09:57:59 PM *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Official site launch very soon, hurrah!


Pages: [1] 2 3 ... 10
 1 
 on: October 14, 2017, 12:20:52 AM 
Started by Dakusan - Last post by Dakusan
A function to replace variables in a file that are in the format "VARIABLE_NAME=VARIABLE_DATA". Parameters are: VARIABLE_NAME VARIABLE_DATA FILE_NAME
Code: [Select]
function ReplaceVar() {
  REPLACE_VAR_NAME="$1";
  REPLACE_VAR_VAL=$(echo "$2" | perl -e '$V=<STDIN>; chomp($V); print quotemeta($V)' -);
  perl -pi -e "s/(?<=$REPLACE_VAR_NAME[ \t]*=).*$/$REPLACE_VAR_VAL/" "$3"
}

The real difference between this script and normal command-line-Perl-regex-replaces is that it makes sure values are properly escaped for the search+replace regular expression.

 2 
 on: October 10, 2017, 06:35:19 PM 
Started by Dakusan - Last post by Dakusan
Original post for Ping Connectivity Monitor can be found at https://www.castledragmire.com/Posts/Ping_Connectivity_Monitor.
Originally posted on: 10/11/17

The following is a simple bash script to ping a different domain once a second and log the output. By default, it pings #.castledragmire.com, where # is an incrementing number starting from 0.

The script is written for Cygwin (See the PING_COMMAND variable at the top) but is very easily adaptable to Linux.

The log output is: EPOCH_TIMESTAMP DOMAIN PING_OUTPUT



#This uses Window's native ping since the Cygwin ping is sorely lacking in options
#"-n 1"=Only runs once, "-w 3000"=Timeout after 3 seconds
#The grep strings are also directly tailored for Window's native ping
PING_COMMAND=$(
   echo 'C:/Windows/System32/PING.EXE -n 1 -w 3000 $DOMAIN |';
   echo 'grep -iP "^(Request timed out|Reply from|Ping request could not find)"';
)

i=0 #The subdomain counter
STARTTIME=`date +%s.%N` #This holds the timestamp of the end of the previous loop

#Infinite loop
while true
do
   #Get the domain to run. This requires a domain that has a wildcard as a primary subdomain
   DOMAIN="$i.castledragmire.com"

   #Output the time, domain name, and ping output
   echo `date +%s` "$DOMAIN" $(eval $PING_COMMAND)

   #If less than a second has passed, sleep up to 1 second
   ENDTIME=`date +%s.%N`
   SLEEPTIME=$(echo "1 - ($ENDTIME - $STARTTIME)" | bc)
   STARTTIME=$ENDTIME
   if [ $(echo "$SLEEPTIME>0" | bc) -eq 1 ]; then
      sleep $SLEEPTIME
      STARTTIME=$(echo "$STARTTIME + $SLEEPTIME" | bc)
   fi

   #Increment the subdomain counter
   let i+=1
done

 3 
 on: August 22, 2017, 09:54:10 AM 
Started by Dakusan - Last post by clod
I like to use Codelobster to debug PHP projects

 4 
 on: July 24, 2017, 12:00:18 PM 
Started by Dakusan - Last post by Dakusan
I'm very sorry to everyone who has been waiting for me to get some updates done. I've just been super busy lately and getting to spend time on this project has just been impossible. I will be getting to it as soon as I can.

 5 
 on: July 07, 2017, 04:52:58 PM 
Started by Dakusan - Last post by Dakusan
Most likely a database update :-\ I'll take a look at it as soon as I have a chance. (Should be sometime in the next week)

 6 
 on: June 26, 2017, 02:35:11 AM 
Started by Dakusan - Last post by Dakusan
Ahah. Should have thought of that. The latest version on github has options for plex user accounts, but I don't think I've put it on my site yet.

 7 
 on: June 24, 2017, 11:47:49 AM 
Started by Dakusan - Last post by Dakusan
First, "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" needs to be quoted, since it has spaces, or your command line interpreter will think those are separate parameters.

I'm surprised it decided to import at all with what you gave it, since you gave an unquoted (and therefore bogus) path to the database. I'm guessing it found the path on its own so it didn't error out.

Second, you only gave the "Playlist_Path" parameter and not a "Plex_Playlist_Name" parameter.

 8 
 on: June 19, 2017, 04:09:42 PM 
Started by Dakusan - Last post by Dakusan
"DB Error: no such module: fts4" indicates an outdated or incomplete sqlite3 version. Google also points out that this happens when trying to compile for iOS, or possibly osx.

 9 
 on: May 30, 2017, 08:18:38 PM 
Started by Dakusan - Last post by Dakusan
To log all process spawns from a user:
(Fill in USERNAME)
Code: [Select]
auditctl -a exit,always -S execve -F uid=USERNAME
To grep for only these entries, and exclude processes:
(Fill in USERID)
(EXCLUDE_REGEX=A regular expression of process names to exclude. Ex: cron|dovecot)
Code: [Select]
ausearch -m ALL | perl -0777 -e 'print grep(/uid=USERID/, grep(!/REGEX/im, split(/^----$/m, <>)))'Using user searches (-ua -ue -ui -ul) for ausearch may work too, but I've found it unreliable.

 10 
 on: March 01, 2017, 09:08:12 PM 
Started by Dakusan - Last post by Dakusan

It took me days to get a Windows 7 install back up when I lost a drive with the MBR record that booted to my GPT drive. The windows booting and install processes are just REALLY finicky and temperamental. One of my largest problems was that I couldn’t find certain required files online, so the only way to acquire them was to unhook all but 1 GPT partitioned drive from the computer and install Windows to it.

Here are the files needed to boot Windows 7 x64 from a GPT drive, assuming your mother board supports EFI. The first step is creating a system partition anywhere on the drive (you may have to shrink another partition) and extract these files to that partition. This blog post has good instructions on the entire process, however, instead of using bcdboot, I recommend using “bootrec /ScanOS” followed by “bootrec /RebuildBCD”. You MAY also need a “bootrec /FixMBR”.

These files were obtained from a Windows 7 x64 Ultimate install, so it should work if your install type matches. I expect it will work for any Windows version of an x64 install.


Here is a list of the files:

EFI
??? Boot
?   ??? bootx64.efi
??? Microsoft
   ??? Boot
       ??? bootmgfw.efi
       ??? bootmgr.efi
       ??? BOOTSTAT.DAT
       ??? cs-CZ
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? da-DK
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? de-DE
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? el-GR
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? en-US
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ?   ??? memtest.efi.mui
       ??? es-ES
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? fi-FI
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? Fonts
       ?   ??? chs_boot.ttf
       ?   ??? cht_boot.ttf
       ?   ??? jpn_boot.ttf
       ?   ??? kor_boot.ttf
       ?   ??? wgl4_boot.ttf
       ??? fr-FR
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? hu-HU
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? it-IT
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? ja-JP
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? ko-KR
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? memtest.efi
       ??? nb-NO
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? nl-NL
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? pl-PL
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? pt-BR
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? pt-PT
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? ru-RU
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? sv-SE
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? tr-TR
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? zh-CN
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? zh-HK
       ?   ??? bootmgfw.efi.mui
       ?   ??? bootmgr.efi.mui
       ??? zh-TW
           ??? bootmgfw.efi.mui
           ??? bootmgr.efi.mui

27 directories, 57 files

“EFI\Microsoft\Boot\BCD” is not included because it is computer dependent and is created with the bootrec command.
“EFI\Microsoft\Boot\BCD.LOG*” are not included for obvious reasons.

Pages: [1] 2 3 ... 10