Home Page
  • May 05, 2024, 02:32:44 am *
  • 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 [4] 5 6 ... 10
 31 
 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.

 32 
 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.

 33 
 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.

 34 
 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.

 35 
 on: February 18, 2017, 12:38:34 pm 
Started by Dakusan - Last post by Dakusan

I decided to try out the PHP IDE PHPStorm by jet brains (you know, the people that made android studio) again recently but ran into a few problems. I tried it a while back and I abandoned it because I was using the browser connect method instead of xdebug and it was a major PITA. This time around, I tried xdebug and everything works much smoother and easier. However, there is a major bug with it in which single line statements inside control statements could not be stopped on in the debugger (breakpoint or stepping). This has been a problem since 2012 and was marked until very recently as unfixable. I am honestly shocked this is not a thing more cited. Do people just not use that form of formatting anymore? I find it much cleaner. Example:


if(true)
 $a=1; //This line could never be reached
So all code like this had to be changed to the following for debugging.

if(true) {
 $a=1;
}

However, in a comment by one of the developers on 2016-12-11 (just 2 months ago) he said “This turned out to be a duplicate of 1165, for which I now have cooked up a fix, which will make it into 2.5.1.”. Unfortunately, there has not yet been a release of this version, so I was forced to a compile a copy myself on Windows. This turned out to also be a major PITA. I have documented the process here. Here is the version I compiled (7.1.2 threadsafe x86)

  • To compile a php extension, you also have to compile php itself. So first download both the source and zip files for your chosen version. I used the latest version, 7.1.2 VC14 x86 Thread Safe (2017-Feb-14 23:28:41) [7.1.2 source]. The source is needed for obvious reasons. The binary is needed so we can extract some dlls not included with the source. Extract the php source root directory files to “c:\php\src.
  • You also need to grab the xdebug source [github] via “git clone git://github.com/xdebug/xdebug.git”. I used commit #62ac284bf36f7521e78d2b21492ce2899f7cc4ff #379ab7ab68d28d0af8f637aa28c7e9fab921f27a, but it actually had a bug in it which I fixed in my fork. I sent a pull request so it should hopefully be integrated soon. Clone the git repo in “c:\php\src-extensions” (it will create the “xdebug” directory inside of it)
  • You will also need visual studio 14.0 (VS 2015) [direct download] installed.
  • Once visual studio is installed, you need to open “Developer Command Prompt for VS2015”. It can be found in your start menu under “Programs\Visual Studio 2015\Visual Studio Tools”.
  • Run the following commands to get php compiled:

    cd\php\src
    buildconf --add-modules-dir=..\src-extensions
    :: You may want some different flags for the below command
    configure "--enable-snapshot-build" "--enable-debug-pack" "--without-pdo-mssql" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer"
    :: At this point we are going to actually build php to get the phpize.bat
    :: You may receive some warnings at the end that say something to the extent of
    :: “'-9' is not recognized as an internal or external command”. You can ignore these
    nmake snap
    :: This next command will “install” php to “c:\php”.
    nmake install
  • Next we get to compile xdebug. But it requirements bison, which can be downloaded here [Direct download]. Extract bin/bison.exe and bin/m4.exe to the VC/bin directory, most likely at “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin”.

    For some reason, the first time I did this process I needed the following files also in VC/bin directory, all found at http://gnuwin32.sourceforge.net. However, during my second run to create this tutorial, I did not need them. iconv.exe, libcharset1.dll, libiconv2.dll, libintl3.dll, mspdb110.dll, regex2.dll. And the “share” folder from the bison zip file needed to be extracted to “C:\Program Files (x86)”.
  • Some file edits in the xdebug directory:
    • Add the following line to the top of configure.js: “PHP_SECURITY_FLAGS=true;
    • If you are using the commit I mentioned, Add the following to line 471 of xdebug_code_coverage.c “zend_op *base_address = &(opa->opcodes[0]);
    • Also edit line 9 of template.rc by changing it from “#include "main/php_version.h"” to “#include "../../src/main/php_version.h"
  • And now to actually compile xdebug

    cd ..\src-extensions\xdebug
    ..\..\SDK\phpize
    configure --with-xdebug
    nmake php_xdebug.dll
    copy Release_TS\php_xdebug.dll ..\..\ext
  • Your complete php install is now located in “c:\php”. But exclude the “src” and “src-extensions” folder. It still needs a few dlls that are found in the php zip file you downloaded earlier. Extract all the dlls from that root of that file to your root php folder, but do not overwrite anything that is already there. If you wanted to compile your own version of the apache dll, you can add one of “--enable-apache2handler, --enable-apache2-2handler, --enable-apache2-4handler” to the src/configure command.
  • For some really odd reason, my version of php would always give me the following error “Packets out of order. Expected 3 received 2. Packet size=22” when trying to connect to mysql (both pdo and mysqli go through mysqlnd). So I just ended up using the php files provided through the zip file, with my newly compiled xdebug dll.
  • Definitely have to mention that the following blog post was a big help to me in figuring this all out: http://blog.benoitblanchon.fr/build-php-extension-on-windows/

 36 
 on: February 17, 2017, 02:47:07 am 
Started by Dakusan - Last post by Dakusan
Same disclaimer. Guess I gotta add command line flags for this and update on github. Already have 1 pull request on github. PITA cause I don't release code without thoroughly testing.

Line 137. Change
Code: [Select]
sys.exit("File not found in DB: "+FilePath)to
Code: [Select]
continueWhen I update on github it will throw a warning instead.

 37 
 on: February 16, 2017, 03:56:28 am 
Started by Dakusan - Last post by Dakusan
Had a need today to sync file modification timestamps between plex and the actual files. Code is as follows.

Code: [Select]
#Dump from sqlite (DB should be in C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-in Support\Databases
sqlite3 com.plexapp.plugins.library.db 'select file, updated_at from media_parts' | \
sort | uniq | perl -pe 's/\\/\//g' | perl -pe 's/^\w:/\./gi' | perl -pe 's/\|/\t/g' | \
grep -viP '^((DRIVES_TO_IGNORE):|\./(DIRECTORIES_TO_IGNORE)|\|$)' > NAME_CHECKS

#Find all files with their modification timestamps
find -L -type f -printf "%p\t%TY-%Tm-%Td %TH:%TM:%.2TS\n" | sort > FTIMES2

#Filter out unwanted folders and file extensions. I did this as a separate command from the above line to allow filtering without having to run a find on the entire drive again
cat FTIMES2 | grep -vP '\.(md5|torrent|sub|idx|nfo|srt|txt|ssa|log|db|jpg|tbn|sfv|png|cbz|rar|cbr|OTHER_EXTENSIONS)\t' | grep -vP '^./(System Volume Information|\$RECYCLE\.BIN|OTHER_FOLDERS)/' > FTIMES

#After comparing the 2 files and extracting any files that need to be updated, run this regular expression on the data to get touch commands to update the timestamps
^(.*)\t\d\d(\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$ => touch -m -t $2$3$4$5$6.$7 "$1"

 38 
 on: February 14, 2017, 10:23:31 am 
Started by Dakusan - Last post by Dakusan
In PlexPlaylistImporter.py, below line 177
Code: [Select]
#Insert the items into the playlistAdd the following line
Code: [Select]
Cur.execute('DELETE FROM play_queue_generators WHERE playlist_id=?', (PlexPlaylistID,))
I have not tested this code, so make sure to backup your database before attempting it.

 39 
 on: January 20, 2017, 09:05:24 am 
Started by Dakusan - Last post by Dakusan
List joined hard links. Same links are separated by tab with a newline between each set.

Code: [Select]
find -links +1 | xargs -d"\n" ls -i | perl -e 'foreach $Line (<STDIN>) { @Cols=($Line=~/^\s*(\d+)\s*(.*?)\s*$/); push(@{$Link{$Cols[0]}}, $Cols[1]); } foreach $List (values %Link) { print join("\t", @{$List})."\n"; }'

 40 
 on: January 06, 2017, 04:15:20 am 
Started by Dakusan - Last post by Dakusan
Original post for Ittle Dew 2 Map can be found at https://www.castledragmire.com/Posts/Ittle_Dew_2_Map.
Originally posted on: 01/06/17

Just something that might be useful to others. I couldn’t find a copy of this anywhere else online. This should contain every point on the map. If anyone finds any more, please let me know!


Ittle Dew 2 Full Map

Pages: 1 2 3 [4] 5 6 ... 10